Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
#[repr(u16)]
pub enum SyntaxKind {
Show 140 variants PackageKw = 0, ImportKw = 1, AsKw = 2, InternalKw = 3, TypeKw = 4, ConstKw = 5, StructKw = 6, EnumKw = 7, EnumsetKw = 8, UnionKw = 9, BooleanKw = 10, IntegerKw = 11, FloatKw = 12, StringKw = 13, BytesKw = 14, TrueKw = 15, FalseKw = 16, StepKw = 17, MatchKw = 18, ReservedKw = 19, ErrorKw = 20, InterfaceKw = 21, ServiceKw = 22, SignalKw = 23, EventKw = 24, CommandKw = 25, QueryKw = 26, FixedKw = 27, RequireKw = 28, EnsureKw = 29, SystemKw = 30, ComponentKw = 31, DistributionKw = 32, DeploymentKw = 33, MachineKw = 34, OffersKw = 35, RequiresKw = 36, ForKw = 37, ReservedWord = 38, Ident = 39, IntNumber = 40, FloatNumber = 41, String = 42, Regex = 43, Duration = 44, Colon = 45, Eq = 46, LBracket = 47, RBracket = 48, LBrace = 49, RBrace = 50, LParen = 51, RParen = 52, DotDot = 53, Dot = 54, Slash = 55, Comma = 56, Question = 57, Semicolon = 58, At = 59, Pipe = 60, Percent = 61, Minus = 62, Lt = 63, Le = 64, Gt = 65, Ge = 66, EqEq = 67, Neq = 68, AmpAmp = 69, PipePipe = 70, Bang = 71, Plus = 72, Star = 73, Whitespace = 74, LineComment = 75, BlockComment = 76, DocComment = 77, Error = 78, SourceFile = 79, PackageDecl = 80, Import = 81, TypeDef = 82, ConstDef = 83, StructDef = 84, FieldDef = 85, ReservedEntry = 86, EnumDef = 87, EnumValue = 88, EnumSetDef = 89, EnumSetBit = 90, UnionDef = 91, UnionArm = 92, TupleType = 93, TupleField = 94, ArrayType = 95, MapType = 96, OptionalType = 97, PathType = 98, PrimitiveType = 99, UnitExpr = 100, Constraint = 101, Bound = 102, Name = 103, QualifiedName = 104, Literal = 105, InitValue = 106, InterfaceDef = 107, SignalDef = 108, EventDef = 109, CommandDef = 110, QueryDef = 111, FixedDef = 112, Param = 113, ParamList = 114, ReturnType = 115, StreamType = 116, FallibleType = 117, Timing = 118, TimingRange = 119, AttrBlock = 120, Attribute = 121, AttrValue = 122, BinaryExpr = 123, PrefixExpr = 124, MemberExpr = 125, PathExpr = 126, ParenExpr = 127, LiteralExpr = 128, ServiceDef = 129, DottedName = 130, SystemDef = 131, ComponentDef = 132, ComponentLine = 133, DistributionDef = 134, DeploymentDef = 135, MachineDef = 136, MemberLine = 137, Reference = 138, ErrorNode = 139,
}
Expand description

The kinds of syntax tokens and nodes the family grammar produces.

The token variants are the full family token set the lexer recognises (docs/ROADMAP.md epic E1.1, typl reference §1.4 and §2). The node variants are the typl grammar’s node inventory (epic E1.2a) — one variant per rule in family.ungram, plus ErrorNode for recovery. RidlLanguage maps between this enum and rowan’s raw kind through the #[repr(u16)] discriminants, so the node variants stay grouped at the end with ErrorNode last — that is the range the kind_from_raw assertion below guards.

Variants§

§

PackageKw = 0

§

ImportKw = 1

§

AsKw = 2

§

InternalKw = 3

§

TypeKw = 4

§

ConstKw = 5

§

StructKw = 6

§

EnumKw = 7

§

EnumsetKw = 8

§

UnionKw = 9

§

BooleanKw = 10

§

IntegerKw = 11

§

FloatKw = 12

§

StringKw = 13

§

BytesKw = 14

§

TrueKw = 15

§

FalseKw = 16

§

StepKw = 17

§

MatchKw = 18

§

ReservedKw = 19

§

ErrorKw = 20

§

InterfaceKw = 21

§

ServiceKw = 22

§

SignalKw = 23

§

EventKw = 24

§

CommandKw = 25

§

QueryKw = 26

§

FixedKw = 27

§

RequireKw = 28

§

EnsureKw = 29

§

SystemKw = 30

§

ComponentKw = 31

§

DistributionKw = 32

§

DeploymentKw = 33

§

MachineKw = 34

§

OffersKw = 35

§

RequiresKw = 36

§

ForKw = 37

§

ReservedWord = 38

A family-registry word that the active profile does not use (typl reference §1.4). Reserved in every profile, never a valid identifier.

§

Ident = 39

§

IntNumber = 40

§

FloatNumber = 41

§

String = 42

§

Regex = 43

§

Duration = 44

§

Colon = 45

§

Eq = 46

§

LBracket = 47

§

RBracket = 48

§

LBrace = 49

§

RBrace = 50

§

LParen = 51

§

RParen = 52

§

DotDot = 53

§

Dot = 54

§

Slash = 55

§

Comma = 56

§

Question = 57

§

Semicolon = 58

§

At = 59

§

Pipe = 60

§

Percent = 61

§

Minus = 62

§

Lt = 63

§

Le = 64

§

Gt = 65

§

Ge = 66

§

EqEq = 67

§

Neq = 68

§

AmpAmp = 69

§

PipePipe = 70

§

Bang = 71

§

Plus = 72

§

Star = 73

§

Whitespace = 74

§

LineComment = 75

§

BlockComment = 76

§

DocComment = 77

§

Error = 78

§

SourceFile = 79

§

PackageDecl = 80

§

Import = 81

§

TypeDef = 82

§

ConstDef = 83

§

StructDef = 84

§

FieldDef = 85

§

ReservedEntry = 86

§

EnumDef = 87

§

EnumValue = 88

§

EnumSetDef = 89

§

EnumSetBit = 90

§

UnionDef = 91

§

UnionArm = 92

§

TupleType = 93

§

TupleField = 94

§

ArrayType = 95

§

MapType = 96

§

OptionalType = 97

§

PathType = 98

§

PrimitiveType = 99

§

UnitExpr = 100

§

Constraint = 101

§

Bound = 102

§

Name = 103

§

QualifiedName = 104

§

Literal = 105

§

InitValue = 106

§

InterfaceDef = 107

§

SignalDef = 108

§

EventDef = 109

§

CommandDef = 110

§

QueryDef = 111

§

FixedDef = 112

§

Param = 113

§

ParamList = 114

§

ReturnType = 115

§

StreamType = 116

§

FallibleType = 117

§

Timing = 118

§

TimingRange = 119

§

AttrBlock = 120

§

Attribute = 121

§

AttrValue = 122

§

BinaryExpr = 123

§

PrefixExpr = 124

§

MemberExpr = 125

§

PathExpr = 126

§

ParenExpr = 127

§

LiteralExpr = 128

§

ServiceDef = 129

§

DottedName = 130

§

SystemDef = 131

§

ComponentDef = 132

§

ComponentLine = 133

§

DistributionDef = 134

§

DeploymentDef = 135

§

MachineDef = 136

§

MemberLine = 137

§

Reference = 138

§

ErrorNode = 139

A recovery node: error recovery wraps the tokens it skips in one of these, so broken input still produces a lossless tree. It is the one node kind with no rule in family.ungram, and the last variant — the kind_from_raw assertion below guards the range up to it.

Implementations§

Source§

impl SyntaxKind

Source

pub fn is_trivia(self) -> bool

Whitespace and comments — tokens that carry no grammatical meaning but must stay in the tree for losslessness. Doc comments are trivia too: the grammar reads them from the trivia preceding a definition.

Trait Implementations§

Source§

impl Clone for SyntaxKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SyntaxKind

Source§

impl Debug for SyntaxKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SyntaxKind

Source§

impl From<SyntaxKind> for SyntaxKind

Source§

fn from(kind: SyntaxKind) -> Self

Converts to this type from the input type.
Source§

impl Hash for SyntaxKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for SyntaxKind

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for SyntaxKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for SyntaxKind

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for SyntaxKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.