pub enum SyntaxKind {
Show 17 variants
WHITESPACE = 0,
NEWLINE = 1,
COMMENT = 2,
IDENT = 3,
ARGUMENT = 4,
DOUBLE_QUOTED_STRING = 5,
SINGLE_QUOTED_STRING = 6,
VARIABLE = 7,
SEMICOLON = 8,
L_BRACE = 9,
R_BRACE = 10,
RAW_CONTENT = 11,
ERROR = 12,
ROOT = 13,
DIRECTIVE = 14,
BLOCK = 15,
BLANK_LINE = 16,
}Expand description
All token and node kinds used by the nginx configuration parser.
Token kinds (leaf nodes) represent individual lexical elements such as identifiers, strings, punctuation, and whitespace. Node kinds (interior nodes) group tokens into higher-level constructs like directives and blocks.
Maintenance note: When adding a new variant, you must also update
to_raw(), from_raw(), and the ALL_KINDS array in the tests.
Variants§
WHITESPACE = 0
Horizontal whitespace (spaces / tabs).
NEWLINE = 1
A newline character (\n).
COMMENT = 2
A comment (# … through end of line).
IDENT = 3
A directive name (alphabetic / _ start, may contain -).
ARGUMENT = 4
An unquoted argument (numbers, paths, regex fragments, …).
DOUBLE_QUOTED_STRING = 5
A double-quoted string ("…"), including the quotes.
SINGLE_QUOTED_STRING = 6
A single-quoted string ('…'), including the quotes.
VARIABLE = 7
A variable reference ($var or ${var}).
SEMICOLON = 8
Semicolon (;).
L_BRACE = 9
Opening brace ({).
R_BRACE = 10
Closing brace (}).
RAW_CONTENT = 11
Raw content inside a lua-block or similar directive.
ERROR = 12
A token that the lexer could not classify (error recovery).
ROOT = 13
The root node, corresponding to Config.
DIRECTIVE = 14
A directive node (name + arguments + optional block).
BLOCK = 15
A brace-delimited block ({ … }).
BLANK_LINE = 16
A blank line (whitespace-only line).
Implementations§
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 moreSource§impl Debug for SyntaxKind
impl Debug for SyntaxKind
Source§impl From<SyntaxKind> for SyntaxKind
Converts SyntaxKind to a raw u16 for rowan.
impl From<SyntaxKind> for SyntaxKind
Converts SyntaxKind to a raw u16 for rowan.