class Parser:
Method | fail |
Convenience method that raises exc with the message, passed line number or last line number as well as the current name and filename. |
Method | free_identifier |
Return a new free identifier as ~jinja2.nodes.InternalName . |
Method | parse_assign_target |
No summary |
Method | parse_expression |
Parse an expression. Per default all expressions are parsed, if the optional with_condexpr parameter is set to False conditional expressions are not parsed. |
Method | parse_statements |
No summary |
Method | parse_tuple |
No summary |
Instance Variable | filename |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | stream |
Undocumented |
Method | __init__ |
Undocumented |
Method | _fail_ut_eof |
Undocumented |
Method | fail_eof |
Like fail_unknown_tag but for end of template situations. |
Method | fail_unknown_tag |
Called if the parser encounters an unknown tag. Tries to fail with a human readable error message that could help to identify the problem. |
Method | is_tuple_end |
Are we at the end of a tuple? |
Method | parse |
Parse the whole template into a Template node. |
Method | parse_and |
Undocumented |
Method | parse_autoescape |
Undocumented |
Method | parse_block |
Undocumented |
Method | parse_call |
Undocumented |
Method | parse_call_args |
Undocumented |
Method | parse_call_block |
Undocumented |
Method | parse_compare |
Undocumented |
Method | parse_concat |
Undocumented |
Method | parse_condexpr |
Undocumented |
Method | parse_dict |
Undocumented |
Method | parse_extends |
Undocumented |
Method | parse_filter |
Undocumented |
Method | parse_filter_block |
Undocumented |
Method | parse_filter_expr |
Undocumented |
Method | parse_for |
Parse a for loop. |
Method | parse_from |
Undocumented |
Method | parse_if |
Parse an if construct. |
Method | parse_import |
Undocumented |
Method | parse_import_context |
Undocumented |
Method | parse_include |
Undocumented |
Method | parse_list |
Undocumented |
Method | parse_macro |
Undocumented |
Method | parse_math1 |
Undocumented |
Method | parse_math2 |
Undocumented |
Method | parse_not |
Undocumented |
Method | parse_or |
Undocumented |
Method | parse_postfix |
Undocumented |
Method | parse_pow |
Undocumented |
Method | parse_primary |
Undocumented |
Method | parse_print |
Undocumented |
Method | parse_set |
Parse an assign statement. |
Method | parse_signature |
Undocumented |
Method | parse_statement |
Parse a single statement. |
Method | parse_subscribed |
Undocumented |
Method | parse_subscript |
Undocumented |
Method | parse_test |
Undocumented |
Method | parse_unary |
Undocumented |
Method | parse_with |
Undocumented |
Method | subparse |
Undocumented |
Instance Variable | _end_token_stack |
Undocumented |
Instance Variable | _last_identifier |
Undocumented |
Instance Variable | _tag_stack |
Undocumented |
Instance Variable | closed |
Undocumented |
Instance Variable | environment |
Undocumented |
Instance Variable | extensions |
Undocumented |
exc
with the message, passed
line number or last line number as well as the current name and
filename.Parameters | |
msg:str | Undocumented |
lineno:t.Optional[ | Undocumented |
exc:t.Type[ | Undocumented |
Returns | |
te.NoReturn | Undocumented |
~jinja2.nodes.InternalName
.Parameters | |
lineno:t.Optional[ | Undocumented |
Returns | |
nodes.InternalName | Undocumented |
with_tuple
to False
. If only assignments to names are
wanted name_only
can be set to True
. The extra_end_rules
parameter is forwarded to the tuple parsing function. If
with_namespace
is enabled, a namespace assignment may be parsed.Parameters | |
with_tuple:bool | Undocumented |
name_only:bool | Undocumented |
extra_end_rules:t.Optional[ | Undocumented |
with_namespace:bool | Undocumented |
Returns | |
t.Union[ | Undocumented |
with_condexpr
parameter is set to False
conditional
expressions are not parsed.Parameters | |
with_condexpr:bool | Undocumented |
Returns | |
nodes.Expr | Undocumented |
end_tokens
is
reached. Per default the active token in the stream at the end of
the call is the matched end token. If this is not wanted drop_needle
can be set to True
and the end token is removed.Parameters | |
end_tokens:t.Tuple[ | Undocumented |
drop_needle:bool | Undocumented |
Returns | |
t.List[ | Undocumented |
Works like parse_expression
but if multiple expressions are
delimited by a comma a ~jinja2.nodes.Tuple
node is created.
This method could also return a regular expression instead of a tuple
if no commas where found.
The default parsing mode is a full tuple. If simplified
is True
only names and literals are parsed. The no_condexpr
parameter is
forwarded to parse_expression
.
Because tuples do not require delimiters and may end in a bogus comma
an extra hint is needed that marks the end of a tuple. For example
for loops support tuples between for
and in
. In that case the
extra_end_rules
is set to ['name:in'].
explicit_parentheses
is true if the parsing was triggered by an
expression in parentheses. This is used to figure out if an empty
tuple is a valid expression or not.
Parameters | |
simplified:bool | Undocumented |
with_condexpr:bool | Undocumented |
extra_end_rules:t.Optional[ | Undocumented |
explicit_parentheses:bool | Undocumented |
Returns | |
t.Union[ | Undocumented |
Undocumented
Parameters | |
environment:Environment | Undocumented |
source:str | Undocumented |
name:t.Optional[ | Undocumented |
filename:t.Optional[ | Undocumented |
state:t.Optional[ | Undocumented |
Undocumented
Parameters | |
name:t.Optional[ | Undocumented |
end_token_stack:t.List[ | Undocumented |
lineno:t.Optional[ | Undocumented |
Returns | |
te.NoReturn | Undocumented |
Parameters | |
end_tokens:t.Optional[ | Undocumented |
lineno:t.Optional[ | Undocumented |
Returns | |
te.NoReturn | Undocumented |
Parameters | |
name:str | Undocumented |
lineno:t.Optional[ | Undocumented |
Returns | |
te.NoReturn | Undocumented |
Parameters | |
extra_end_rules:t.Optional[ | Undocumented |
Returns | |
bool | Undocumented |
Undocumented
Parameters | |
node:nodes.Expr | Undocumented |
Returns | |
nodes.Call | Undocumented |
Undocumented
Parameters | |
node:t.Optional[ | Undocumented |
start_inline:bool | Undocumented |
Returns | |
t.Optional[ | Undocumented |
Undocumented
Parameters | |
node:nodes.Expr | Undocumented |
Returns | |
nodes.Expr | Undocumented |
Undocumented
Parameters | |
node:_ImportInclude | Undocumented |
default:bool | Undocumented |
Returns | |
_ImportInclude | Undocumented |
Undocumented
Parameters | |
node:nodes.Expr | Undocumented |
Returns | |
nodes.Expr | Undocumented |
Returns | |
t.Union[ | Undocumented |
Returns | |
t.Union[ | Undocumented |
Undocumented
Parameters | |
node:nodes.Expr | Undocumented |
Returns | |
t.Union[ | Undocumented |
Undocumented
Parameters | |
node:nodes.Expr | Undocumented |
Returns | |
nodes.Expr | Undocumented |
Undocumented
Parameters | |
with_filter:bool | Undocumented |
Returns | |
nodes.Expr | Undocumented |
Undocumented
Parameters | |
end_tokens:t.Optional[ | Undocumented |
Returns | |
t.List[ | Undocumented |
t.Dict[ str, t.Callable[ [ Parser], t.Union[ nodes.Node, t.List[ nodes.Node]]]]
=
Undocumented