Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
#[non_exhaustive]
#[repr(u16)]
pub enum SyntaxKind {
Show 93 variants TOKEN_ADD = 0, TOKEN_AND_AND = 1, TOKEN_ASSIGN = 2, TOKEN_ASSERT = 3, TOKEN_AT = 4, TOKEN_COLON = 5, TOKEN_COMMA = 6, TOKEN_COMMENT = 7, TOKEN_CONCAT = 8, TOKEN_CUR_POS = 9, TOKEN_DIV = 10, TOKEN_DOT = 11, TOKEN_ELLIPSIS = 12, TOKEN_ELSE = 13, TOKEN_EQUAL = 14, TOKEN_ERROR = 15, TOKEN_FLOAT = 16, TOKEN_IDENT = 17, TOKEN_IF = 18, TOKEN_IMPLICATION = 19, TOKEN_IN = 20, TOKEN_INHERIT = 21, TOKEN_INTEGER = 22, TOKEN_INTERPOL_END = 23, TOKEN_INTERPOL_START = 24, TOKEN_INVERT = 25, TOKEN_L_BRACE = 26, TOKEN_L_BRACK = 27, TOKEN_L_PAREN = 28, TOKEN_LESS = 29, TOKEN_LESS_OR_EQ = 30, TOKEN_LET = 31, TOKEN_MORE = 32, TOKEN_MORE_OR_EQ = 33, TOKEN_MUL = 34, TOKEN_NOT_EQUAL = 35, TOKEN_OR = 36, TOKEN_OR_OR = 37, TOKEN_PATH_ABS = 38, TOKEN_PATH_HOME = 39, TOKEN_PATH_REL = 40, TOKEN_PATH_SEARCH = 41, TOKEN_PIPE_LEFT = 42, TOKEN_PIPE_RIGHT = 43, TOKEN_QUESTION = 44, TOKEN_R_BRACE = 45, TOKEN_R_BRACK = 46, TOKEN_R_PAREN = 47, TOKEN_REC = 48, TOKEN_SEMICOLON = 49, TOKEN_STRING_CONTENT = 50, TOKEN_STRING_END = 51, TOKEN_STRING_START = 52, TOKEN_SUB = 53, TOKEN_THEN = 54, TOKEN_UPDATE = 55, TOKEN_URI = 56, TOKEN_WHITESPACE = 57, TOKEN_WITH = 58, NODE_APPLY = 59, NODE_ASSERT = 60, NODE_ATTR_SET = 61, NODE_ATTRPATH = 62, NODE_ATTRPATH_VALUE = 63, NODE_BIN_OP = 64, NODE_CUR_POS = 65, NODE_DYNAMIC = 66, NODE_ERROR = 67, NODE_HAS_ATTR = 68, NODE_IDENT = 69, NODE_IDENT_PARAM = 70, NODE_IF_ELSE = 71, NODE_INHERIT = 72, NODE_INHERIT_FROM = 73, NODE_INTERPOL = 74, NODE_LAMBDA = 75, NODE_LEGACY_LET = 76, NODE_LET_IN = 77, NODE_LIST = 78, NODE_LITERAL = 79, NODE_PAREN = 80, NODE_PAT_BIND = 81, NODE_PAT_ENTRY = 82, NODE_PATTERN = 83, NODE_PATH_ABS = 84, NODE_PATH_HOME = 85, NODE_PATH_REL = 86, NODE_PATH_SEARCH = 87, NODE_ROOT = 88, NODE_SELECT = 89, NODE_STRING = 90, NODE_UNARY_OP = 91, NODE_WITH = 92,
}

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

TOKEN_ADD = 0

§

TOKEN_AND_AND = 1

§

TOKEN_ASSIGN = 2

§

TOKEN_ASSERT = 3

§

TOKEN_AT = 4

§

TOKEN_COLON = 5

§

TOKEN_COMMA = 6

§

TOKEN_COMMENT = 7

§

TOKEN_CONCAT = 8

§

TOKEN_CUR_POS = 9

§

TOKEN_DIV = 10

§

TOKEN_DOT = 11

§

TOKEN_ELLIPSIS = 12

§

TOKEN_ELSE = 13

§

TOKEN_EQUAL = 14

§

TOKEN_ERROR = 15

§

TOKEN_FLOAT = 16

§

TOKEN_IDENT = 17

§

TOKEN_IF = 18

§

TOKEN_IMPLICATION = 19

§

TOKEN_IN = 20

§

TOKEN_INHERIT = 21

§

TOKEN_INTEGER = 22

§

TOKEN_INTERPOL_END = 23

§

TOKEN_INTERPOL_START = 24

§

TOKEN_INVERT = 25

§

TOKEN_L_BRACE = 26

§

TOKEN_L_BRACK = 27

§

TOKEN_L_PAREN = 28

§

TOKEN_LESS = 29

§

TOKEN_LESS_OR_EQ = 30

§

TOKEN_LET = 31

§

TOKEN_MORE = 32

§

TOKEN_MORE_OR_EQ = 33

§

TOKEN_MUL = 34

§

TOKEN_NOT_EQUAL = 35

§

TOKEN_OR = 36

§

TOKEN_OR_OR = 37

§

TOKEN_PATH_ABS = 38

§

TOKEN_PATH_HOME = 39

§

TOKEN_PATH_REL = 40

§

TOKEN_PIPE_LEFT = 42

§

TOKEN_PIPE_RIGHT = 43

§

TOKEN_QUESTION = 44

§

TOKEN_R_BRACE = 45

§

TOKEN_R_BRACK = 46

§

TOKEN_R_PAREN = 47

§

TOKEN_REC = 48

§

TOKEN_SEMICOLON = 49

§

TOKEN_STRING_CONTENT = 50

§

TOKEN_STRING_END = 51

§

TOKEN_STRING_START = 52

§

TOKEN_SUB = 53

§

TOKEN_THEN = 54

§

TOKEN_UPDATE = 55

§

TOKEN_URI = 56

§

TOKEN_WHITESPACE = 57

§

TOKEN_WITH = 58

§

NODE_APPLY = 59

§

NODE_ASSERT = 60

§

NODE_ATTR_SET = 61

§

NODE_ATTRPATH = 62

§

NODE_ATTRPATH_VALUE = 63

§

NODE_BIN_OP = 64

§

NODE_CUR_POS = 65

§

NODE_DYNAMIC = 66

§

NODE_ERROR = 67

§

NODE_HAS_ATTR = 68

§

NODE_IDENT = 69

§

NODE_IDENT_PARAM = 70

§

NODE_IF_ELSE = 71

§

NODE_INHERIT = 72

§

NODE_INHERIT_FROM = 73

§

NODE_INTERPOL = 74

§

NODE_LAMBDA = 75

§

NODE_LEGACY_LET = 76

§

NODE_LET_IN = 77

§

NODE_LIST = 78

§

NODE_LITERAL = 79

§

NODE_PAREN = 80

§

NODE_PAT_BIND = 81

§

NODE_PAT_ENTRY = 82

§

NODE_PATTERN = 83

§

NODE_PATH_ABS = 84

§

NODE_PATH_HOME = 85

§

NODE_PATH_REL = 86

§

NODE_ROOT = 88

§

NODE_SELECT = 89

§

NODE_STRING = 90

§

NODE_UNARY_OP = 91

§

NODE_WITH = 92

Implementations§

Source§

impl SyntaxKind

Source

pub fn is_literal(self) -> bool

Returns true if this token is a literal, such as an integer or a string

Source

pub fn is_fn_arg(self) -> bool

Returns true if this token should be used as a function argument.

Example:
add 1 2 + 3
^   ^ ^ ^
|   | | +- false
|   | +- true
|   +- true
+- true
Source

pub fn is_trivia(self) -> bool

Returns true if this token is a comment, whitespace, or similar, and should be skipped over by the parser.

Trait Implementations§

Source§

impl BitOr<()> for SyntaxKind

Source§

type Output = TokenSet

The resulting type after applying the | operator.
Source§

fn bitor(self, (): ()) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<SyntaxKind> for ()

Source§

type Output = TokenSet

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: SyntaxKind) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr for SyntaxKind

Source§

type Output = TokenSet

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl Clone for SyntaxKind

Source§

fn clone(&self) -> SyntaxKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SyntaxKind

Source§

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

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

impl FromStr for SyntaxKind

Source§

type Err = ParseSyntaxKindError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
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: &SyntaxKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

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

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

impl PartialEq for SyntaxKind

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for SyntaxKind

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · 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 · 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 · 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 · 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 Copy for SyntaxKind

Source§

impl Eq for SyntaxKind

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.