class TokenStream:
Method | __next__ |
Go one token ahead and return the old one. |
Method | expect |
Expect a given token type and return it. This accepts the same argument as jinja2.lexer.Token.test . |
Method | look |
Look at the next token. |
Method | next_if |
Perform the token test and return the token if it matched. Otherwise the return value is None . |
Method | push |
Push a token back to the stream. |
Method | skip |
Got n tokens ahead. |
Method | skip_if |
Like next_if but only returns True or False . |
Instance Variable | current |
Undocumented |
Property | eos |
Are we at the end of the stream? |
Method | __bool__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | close |
Close the stream. |
Instance Variable | _iter |
Undocumented |
Instance Variable | _pushed |
Undocumented |
Instance Variable | closed |
Undocumented |
Instance Variable | filename |
Undocumented |
Instance Variable | name |
Undocumented |
Go one token ahead and return the old one.
Use the built-in next
instead of calling this directly.
Returns | |
Token | Undocumented |
jinja2.lexer.Token.test
.Parameters | |
expr:str | Undocumented |
Returns | |
Token | Undocumented |
None
.Parameters | |
expr:str | Undocumented |
Returns | |
t.Optional[ | Undocumented |
Undocumented
Parameters | |
generator:t.Iterable[ | Undocumented |
name:t.Optional[ | Undocumented |
filename:t.Optional[ | Undocumented |