Skip to main content

SyntaxKind

Type Alias SyntaxKind 

Source
pub type SyntaxKind = u16;
Expand description

Stored discriminant for a syntax kind (used internally in green/red trees and events).

Grammar authors can use either raw u16 values or an enum that implements IntoSyntaxKind and FromSyntaxKind, so you don’t need to manage numbering manually. Use the SyntaxKinds derive macro for an enum with automatic discriminants 0, 1, 2, …

Trait Implementations§