class documentation

class Parser:

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method __repr__ Undocumented
Method add​_library Undocumented
Method compile​_filter Convenient wrapper for FilterExpression
Method delete​_first​_token Undocumented
Method error No summary
Method extend​_nodelist Undocumented
Method find​_filter Undocumented
Method invalid​_block​_tag Undocumented
Method next​_token Undocumented
Method parse Iterate through the parser tokens and compiles each one into a node.
Method prepend​_token Undocumented
Method skip​_past Undocumented
Method unclosed​_block​_tag Undocumented
Instance Variable command​_stack Undocumented
Instance Variable filters Undocumented
Instance Variable libraries Undocumented
Instance Variable origin Undocumented
Instance Variable tags Undocumented
Instance Variable tokens Undocumented
def __init__(self, tokens, libraries=None, builtins=None, origin=None):

Undocumented

def __repr__(self):

Undocumented

def add_library(self, lib):

Undocumented

def compile_filter(self, token):
Convenient wrapper for FilterExpression
def delete_first_token(self):

Undocumented

def error(self, token, e):
Return an exception annotated with the originating token. Since the parser can be called recursively, check if a token is already set. This ensures the innermost token is highlighted if an exception occurs, e.g. a compile error within the body of an if statement.
def extend_nodelist(self, nodelist, node, token):

Undocumented

def find_filter(self, filter_name):

Undocumented

def invalid_block_tag(self, token, command, parse_until=None):

Undocumented

def next_token(self):

Undocumented

def parse(self, parse_until=None):

Iterate through the parser tokens and compiles each one into a node.

If parse_until is provided, parsing will stop once one of the specified tokens has been reached. This is formatted as a list of tokens, e.g. ['elif', 'else', 'endif']. If no matching token is reached, raise an exception with the unclosed block tag details.

def prepend_token(self, token):

Undocumented

def skip_past(self, endtag):

Undocumented

def unclosed_block_tag(self, parse_until):

Undocumented

command_stack: list =

Undocumented

filters: dict =

Undocumented

libraries =

Undocumented

origin =

Undocumented

tags: dict =

Undocumented

tokens =

Undocumented