pub enum SyntaxKind {
Show 53 variants
ParenOpen = 0,
ParenClose,
BracketOpen,
BracketClose,
BraceOpen,
BraceClose,
DoubleColon,
Colon,
Equals,
Negation,
Tilde,
Underscore,
Star,
Plus,
Question,
StarQuestion,
PlusQuestion,
QuestionQuestion,
Slash,
Comma,
Pipe,
StringLiteral,
DoubleQuote,
SingleQuote,
StrVal,
KwError,
KwMissing,
Id,
Dot,
At,
Whitespace,
Newline,
LineComment,
BlockComment,
XMLGarbage,
Predicate,
Garbage,
Error,
Root,
Tree,
Ref,
Str,
Field,
Capture,
Type,
Quantifier,
Seq,
Alt,
Branch,
Wildcard,
Anchor,
NegatedField,
Def,
// some variants omitted
}Expand description
All token and node kinds. Tokens first, then nodes, then __LAST sentinel.
#[repr(u16)] enables safe transmute in kind_from_raw.
Variants§
ParenOpen = 0
ParenClose
BracketOpen
BracketClose
BraceOpen
BraceClose
DoubleColon
:: for type annotations. Defined before Colon for correct precedence.
Colon
Equals
Negation
Tilde
Underscore
Star
Plus
Question
StarQuestion
Non-greedy *? quantifier
PlusQuestion
Non-greedy +? quantifier
QuestionQuestion
Non-greedy ?? quantifier
Slash
Slash for supertype paths: (expression/binary_expression)
Comma
Comma (invalid separator, for error recovery)
Pipe
Pipe (invalid separator, for error recovery)
StringLiteral
String literal (split by lexer into quote + content + quote)
DoubleQuote
SingleQuote
StrVal
String content between quotes
KwError
KwMissing
Id
Identifier. Accepts dots/hyphens for tree-sitter compat; parser validates per context. Defined after keywords so they take precedence.
Dot
At
Whitespace
Newline
LineComment
BlockComment
XMLGarbage
XML-like tags matched as errors (common LLM output)
Predicate
Tree-sitter predicates (unsupported)
Garbage
Coalesced unrecognized characters
Error
Root
Tree
Ref
Str
Field
Capture
Type
Quantifier
Seq
Alt
Branch
Wildcard
Anchor
NegatedField
Def
Implementations§
Trait Implementations§
Source§impl Clone for SyntaxKind
impl Clone for SyntaxKind
Source§fn clone(&self) -> SyntaxKind
fn clone(&self) -> SyntaxKind
1.0.0§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
impl From<SyntaxKind> for SyntaxKind
Source§fn from(kind: SyntaxKind) -> Self
fn from(kind: SyntaxKind) -> Self
Source§impl Hash for SyntaxKind
impl Hash for SyntaxKind
Source§impl<'s> Logos<'s> for SyntaxKind
impl<'s> Logos<'s> for SyntaxKind
Source§type Error = ()
type Error = ()
#[logos(error = MyError)]. Defaults to () if not set.Source§type Extras = ()
type Extras = ()
Extras for the particular lexer. This can be set using
#[logos(extras = MyExtras)] and accessed inside callbacks.Source§type Source = str
type Source = str
str,
unless one of the defined patterns explicitly uses non-unicode byte values
or byte slices, in which case that implementation will use [u8].Source§fn lex(
lex: &mut Lexer<'s, Self>,
) -> Option<Result<Self, <Self as Logos<'s>>::Error>>
fn lex( lex: &mut Lexer<'s, Self>, ) -> Option<Result<Self, <Self as Logos<'s>>::Error>>
Lexer. The implementation for this function
is generated by the logos-derive crate.Source§impl Ord for SyntaxKind
impl Ord for SyntaxKind
Source§impl PartialEq for SyntaxKind
impl PartialEq for SyntaxKind
Source§impl PartialOrd for SyntaxKind
impl PartialOrd for SyntaxKind
impl Copy for SyntaxKind
impl Eq for SyntaxKind
impl StructuralPartialEq for SyntaxKind
Auto Trait Implementations§
impl Freeze for SyntaxKind
impl RefUnwindSafe for SyntaxKind
impl Send for SyntaxKind
impl Sync for SyntaxKind
impl Unpin for SyntaxKind
impl UnwindSafe for SyntaxKind
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.