pub enum SyntaxKind {
Show 33 variants
L_BRACE = 0,
R_BRACE,
L_PAREN,
R_PAREN,
COMMA,
GT,
AT,
BARE_SCALAR,
QUOTED_SCALAR,
RAW_SCALAR,
HEREDOC_START,
HEREDOC_CONTENT,
HEREDOC_END,
LINE_COMMENT,
DOC_COMMENT,
WHITESPACE,
NEWLINE,
EOF,
ERROR,
DOCUMENT,
ENTRY,
OBJECT,
SEQUENCE,
SCALAR,
UNIT,
TAG,
TAG_NAME,
TAG_PAYLOAD,
KEY,
VALUE,
HEREDOC,
ATTRIBUTES,
ATTRIBUTE,
// some variants omitted
}Expand description
The kind of a syntax element (node or token).
Tokens are terminal elements (leaves), while nodes are non-terminal
(contain children). The distinction is made by value: tokens have
lower values than __LAST_TOKEN.
The SCREAMING_CASE naming convention is used to match rowan/rust-analyzer conventions for syntax kinds.
Variants§
L_BRACE = 0
{
R_BRACE
}
L_PAREN
(
R_PAREN
)
COMMA
,
GT
=
AT
@
BARE_SCALAR
Bare (unquoted) scalar: hello, 42, true
QUOTED_SCALAR
Quoted scalar: "hello world"
RAW_SCALAR
Raw scalar: r#"..."#
HEREDOC_START
Heredoc start marker: <<DELIM\n
HEREDOC_CONTENT
Heredoc content
HEREDOC_END
Heredoc end marker
LINE_COMMENT
Line comment: // ...
DOC_COMMENT
Doc comment: /// ...
WHITESPACE
Horizontal whitespace (spaces, tabs)
NEWLINE
Newline (\n or \r\n)
EOF
End of file
ERROR
Lexer/parser error
DOCUMENT
Root document node
ENTRY
An entry (key-value pair or sequence element)
OBJECT
An explicit object { ... }
SEQUENCE
A sequence ( ... )
SCALAR
A scalar value wrapper
UNIT
Unit value @
TAG
A tag @name with optional payload
TAG_NAME
Tag name (without @)
TAG_PAYLOAD
Tag payload (the value after the tag name)
KEY
Key in an entry
VALUE
Value in an entry
HEREDOC
A heredoc (groups start, content, end)
ATTRIBUTES
A group of attributes (key=value pairs)
ATTRIBUTE
A single attribute (key=value)
Implementations§
Source§impl SyntaxKind
impl SyntaxKind
Trait Implementations§
Source§impl Clone for SyntaxKind
impl Clone for SyntaxKind
Source§fn clone(&self) -> SyntaxKind
fn clone(&self) -> SyntaxKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more