pip_services3_expressions.mustache.parsers package

Submodules

Module contents

class pip_services3_expressions.mustache.parsers.MustacheErrorCode

Bases: object

General syntax errors.

ERROR_AT: str = 'ERROR_AT'
ERROR_NEAR: str = 'ERROR_NEAR'
INTERNAL: str = 'INTERNAL'
MISMATCHED_BRACKETS: str = 'MISMATCHED_BRACKETS'
MISSING_VARIABLE: str = 'MISSING_VARIABLE'
NOT_CLOSED_SECTION: str = 'NOT_CLOSED_SECTION'
UNEXPECTED_END: str = 'UNEXPECTED_END'
UNEXPECTED_SECTION_END: str = 'UNEXPECTED_SECTION_END'
UNEXPECTED_SYMBOL: str = 'UNEXPECTED_SYMBOL'
UNKNOWN: str = 'UNKNOWN'
class pip_services3_expressions.mustache.parsers.MustacheLexicalState(value)

Bases: enum.Enum

Define states in mustache lexical analysis.

Closure = 5
Comment = 4
Operator1 = 1
Operator2 = 2
Value = 0
Variable = 3
class pip_services3_expressions.mustache.parsers.MustacheParser

Bases: object

Implements an mustache parser class.

clear()

Clears parsing results.

property initial_tokens

The list of original mustache tokens.

property original_tokens
parse_string(mustache: str)

Sets a new mustache string and parses it into internal byte code.

Parameters

mustache – A new mustache string.

parse_tokens(tokens: List[pip_services3_expressions.tokenizers.Token.Token])
property result_tokens

The list of parsed mustache tokens.

property template

The mustache template.

property variable_names

The list of found variable names.

class pip_services3_expressions.mustache.parsers.MustacheToken(type: pip_services3_expressions.mustache.parsers.MustacheTokenType.MustacheTokenType, value: str, line: int, column: int)

Bases: object

Defines a mustache token holder.

property column

The column number where the token is.

property line

The line number where the token is.

property tokens

Gets a list of subtokens is this token a section.

property type

Gets the token value or variable name.

property value

Gets the token value or variable name.