pub enum DjangoTokenType {
Show 67 variants
Identifier,
Number,
String,
Whitespace,
Newline,
Comment,
VariableStart,
VariableEnd,
TagStart,
TagEnd,
CommentStart,
CommentEnd,
If,
Elif,
Else,
Endif,
For,
Empty,
Endfor,
Block,
Endblock,
Extends,
Include,
Load,
With,
Endwith,
Autoescape,
Endautoescape,
Csrf,
Url,
Static,
Now,
Cycle,
Filter,
Endfilter,
Spaceless,
Endspaceless,
Verbatim,
Endverbatim,
And,
Or,
Not,
In,
Dot,
Pipe,
Colon,
Comma,
Equal,
EqualEqual,
NotEqual,
Less,
Greater,
LessEqual,
GreaterEqual,
Plus,
Minus,
Star,
Slash,
Percent,
LeftParen,
RightParen,
LeftBracket,
RightBracket,
Semicolon,
HtmlContent,
Eof,
Error,
}Expand description
Token types for the Django template lexer.
This enum represents all possible token types in Django templates, including template tags, variables, filters, and HTML content.
Variants§
Identifier
Identifier token.
Number
Number literal token.
String
String literal token.
Whitespace
Whitespace token.
Newline
Newline token.
Comment
Comment token.
VariableStart
Variable start delimiter {{.
VariableEnd
Variable end delimiter }}.
TagStart
Tag start delimiter {%.
TagEnd
Tag end delimiter %}.
CommentStart
Comment start delimiter {#.
CommentEnd
Comment end delimiter #}.
If
if keyword for conditional blocks.
Elif
elif keyword for else-if branches.
Else
else keyword for else branches.
Endif
endif keyword to close if blocks.
For
for keyword for loop blocks.
Empty
empty keyword for empty loop fallback.
Endfor
endfor keyword to close for loops.
Block
block keyword for template inheritance.
Endblock
endblock keyword to close block sections.
Extends
extends keyword for template inheritance.
Include
include keyword for including other templates.
Load
load keyword for loading template tags.
With
with keyword for context variables.
Endwith
endwith keyword to close with blocks.
Autoescape
autoescape keyword for auto-escaping.
Endautoescape
endautoescape keyword to close autoescape blocks.
Csrf
csrf_token tag for CSRF protection.
Url
url tag for URL resolution.
Static
static tag for static file references.
Now
now tag for current datetime.
Cycle
cycle tag for cycling values.
Filter
filter tag for filter sections.
Endfilter
endfilter keyword to close filter blocks.
Spaceless
spaceless tag for removing whitespace.
Endspaceless
endspaceless keyword to close spaceless blocks.
Verbatim
verbatim tag for literal content.
Endverbatim
endverbatim keyword to close verbatim blocks.
And
and logical operator.
Or
or logical operator.
Not
not logical operator.
In
in membership operator.
Dot
Dot operator ..
Pipe
Pipe operator | for filters.
Colon
Colon :.
Comma
Comma ,.
Equal
Assignment operator =.
EqualEqual
Equality operator ==.
NotEqual
Inequality operator !=.
Less
Less than operator <.
Greater
Greater than operator >.
LessEqual
Less than or equal operator <=.
GreaterEqual
Greater than or equal operator >=.
Plus
Plus operator +.
Minus
Minus operator -.
Star
Multiplication operator *.
Slash
Division operator /.
Percent
Modulo operator %.
LeftParen
Left parenthesis (.
RightParen
Right parenthesis ).
LeftBracket
Left bracket [.
RightBracket
Right bracket ].
Semicolon
Semicolon ;.
HtmlContent
HTML content outside Django tags.
Eof
End of file token.
Error
Error token for invalid input.
Implementations§
Trait Implementations§
Source§impl Clone for DjangoTokenType
impl Clone for DjangoTokenType
Source§fn clone(&self) -> DjangoTokenType
fn clone(&self) -> DjangoTokenType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more