Tokens
liquid2.token.TokenT
dataclass
liquid2.token.TokenType
Bases: Enum
liquid2.token.BlockCommentToken
dataclass
liquid2.token.CommentToken
dataclass
liquid2.token.ContentToken
dataclass
liquid2.token.ErrorToken
dataclass
Bases: TokenT
A token representing a syntax error found by the lexer.
liquid2.token.InlineCommentToken
dataclass
Bases: CommentToken
A token representing an inline comment tag.
That's one with #
as the tag name. Like {% # some comment %}
.
liquid2.token.LinesToken
dataclass
Bases: TokenT
A token representing line statements, where each line is a tag expression.
The built-in {% liquid %}
tag is an example of a tag that uses line statements.
liquid2.token.OutputToken
dataclass
liquid2.token.PathToken
dataclass
liquid2.token.RangeToken
dataclass
liquid2.token.RawToken
dataclass
liquid2.token.TagToken
dataclass
Bases: TokenT
A token representing a tag.
This could be an inline tag, or the start or end of a block tag.
liquid2.token.Token
dataclass
Bases: TokenT
A liquid expression token.
liquid2.token.is_comment_token
A CommentToken type guard.
liquid2.token.is_content_token
A ContentToken type guard.
liquid2.token.is_lines_token
A LinesToken type guard.
liquid2.token.is_output_token
An OutputToken type guard.
liquid2.token.is_path_token
A PathToken type guard.
liquid2.token.is_range_token
A RangeToken type guard.
liquid2.token.is_raw_token
A RawToken type guard.
liquid2.token.is_tag_token
A TagToken type guard.
liquid2.token.is_token_type
A Token type guard.
liquid2.TokenStream
Step through a stream of tokens.
expect
Raise a LiquidSyntaxError if the current token type doesn't match typ.
expect_one_of
Raise a LiquidSyntaxError if the current token type is not in types.
expect_tag
Raise a syntax error if the current token is not a tag with tag_name.
into_inner
Return a new stream over the current token's expression, consuming the token.
RAISES | DESCRIPTION |
---|---|
LiquidSyntaxError
|
if the current token is not a tag |