class documentation

class Parser: (source)

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 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...
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): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def add_library(self, lib): (source)

Undocumented

def compile_filter(self, token): (source)

Convenient wrapper for FilterExpression

def delete_first_token(self): (source)

Undocumented

def error(self, token, e): (source)

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): (source)

Undocumented

def find_filter(self, filter_name): (source)

Undocumented

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

Undocumented

def next_token(self): (source)

Undocumented

def parse(self, parse_until=None): (source)

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): (source)

Undocumented

def skip_past(self, endtag): (source)

Undocumented

def unclosed_block_tag(self, parse_until): (source)

Undocumented

command_stack: list = (source)

Undocumented

Undocumented

libraries = (source)

Undocumented

Undocumented

Undocumented

Undocumented