Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
pub enum SyntaxKind {
Show 91 variants WHITESPACE = 0, LINE_COMMENT = 1, BLOCK_COMMENT = 2, L_PAREN = 3, R_PAREN = 4, KEYWORD = 5, INSTR_NAME = 6, IDENT = 7, STRING = 8, INT = 9, UNSIGNED_INT = 10, FLOAT = 11, TYPE_KEYWORD = 12, MODIFIER_KEYWORD = 13, EQ = 14, MEM_ARG_KEYWORD = 15, SHAPE_DESCRIPTOR = 16, ANNOT_START = 17, ANNOT_ELEM = 18, ANNOT_END = 19, ERROR = 20, MODULE_NAME = 21, NAME = 22, NUM_TYPE = 23, VEC_TYPE = 24, REF_TYPE = 25, HEAP_TYPE = 26, PACKED_TYPE = 27, FIELD_TYPE = 28, STRUCT_TYPE = 29, ARRAY_TYPE = 30, FUNC_TYPE = 31, CONT_TYPE = 32, PARAM = 33, RESULT = 34, FIELD = 35, SUB_TYPE = 36, TABLE_TYPE = 37, MEM_TYPE = 38, ADDR_TYPE = 39, GLOBAL_TYPE = 40, PLAIN_INSTR = 41, BLOCK_BLOCK = 42, BLOCK_LOOP = 43, BLOCK_IF = 44, BLOCK_IF_THEN = 45, BLOCK_IF_ELSE = 46, BLOCK_TRY_TABLE = 47, CATCH = 48, CATCH_ALL = 49, MEM_ARG = 50, ON_CLAUSE = 51, IMMEDIATE = 52, TYPE_USE = 53, LIMITS = 54, IMPORT = 55, EXPORT = 56, EXTERN_TYPE_FUNC = 57, EXTERN_TYPE_TABLE = 58, EXTERN_TYPE_MEMORY = 59, EXTERN_TYPE_GLOBAL = 60, EXTERN_TYPE_TAG = 61, EXTERN_IDX_FUNC = 62, EXTERN_IDX_TABLE = 63, EXTERN_IDX_MEMORY = 64, EXTERN_IDX_GLOBAL = 65, EXTERN_IDX_TAG = 66, INDEX = 67, LOCAL = 68, MEM_PAGE_SIZE = 69, MEM_USE = 70, OFFSET = 71, ELEM = 72, ELEM_LIST = 73, ELEM_EXPR = 74, TABLE_USE = 75, DATA = 76, MODULE = 77, MODULE_FIELD_DATA = 78, MODULE_FIELD_ELEM = 79, MODULE_FIELD_EXPORT = 80, MODULE_FIELD_FUNC = 81, MODULE_FIELD_GLOBAL = 82, MODULE_FIELD_IMPORT = 83, MODULE_FIELD_MEMORY = 84, MODULE_FIELD_START = 85, MODULE_FIELD_TABLE = 86, MODULE_FIELD_TAG = 87, TYPE_DEF = 88, REC_TYPE = 89, ROOT = 90,
}
Expand description

Syntax kind enum for nodes and tokens.

Variants§

§

WHITESPACE = 0

§

LINE_COMMENT = 1

§

BLOCK_COMMENT = 2

§

L_PAREN = 3

§

R_PAREN = 4

§

KEYWORD = 5

§

INSTR_NAME = 6

§

IDENT = 7

§

STRING = 8

§

INT = 9

§

UNSIGNED_INT = 10

§

FLOAT = 11

§

TYPE_KEYWORD = 12

§

MODIFIER_KEYWORD = 13

§

EQ = 14

§

MEM_ARG_KEYWORD = 15

§

SHAPE_DESCRIPTOR = 16

§

ANNOT_START = 17

§

ANNOT_ELEM = 18

§

ANNOT_END = 19

§

ERROR = 20

§

MODULE_NAME = 21

§

NAME = 22

§

NUM_TYPE = 23

§

VEC_TYPE = 24

§

REF_TYPE = 25

§

HEAP_TYPE = 26

§

PACKED_TYPE = 27

§

FIELD_TYPE = 28

§

STRUCT_TYPE = 29

§

ARRAY_TYPE = 30

§

FUNC_TYPE = 31

§

CONT_TYPE = 32

§

PARAM = 33

§

RESULT = 34

§

FIELD = 35

§

SUB_TYPE = 36

§

TABLE_TYPE = 37

§

MEM_TYPE = 38

§

ADDR_TYPE = 39

§

GLOBAL_TYPE = 40

§

PLAIN_INSTR = 41

§

BLOCK_BLOCK = 42

§

BLOCK_LOOP = 43

§

BLOCK_IF = 44

§

BLOCK_IF_THEN = 45

§

BLOCK_IF_ELSE = 46

§

BLOCK_TRY_TABLE = 47

§

CATCH = 48

§

CATCH_ALL = 49

§

MEM_ARG = 50

§

ON_CLAUSE = 51

§

IMMEDIATE = 52

§

TYPE_USE = 53

§

LIMITS = 54

§

IMPORT = 55

§

EXPORT = 56

§

EXTERN_TYPE_FUNC = 57

§

EXTERN_TYPE_TABLE = 58

§

EXTERN_TYPE_MEMORY = 59

§

EXTERN_TYPE_GLOBAL = 60

§

EXTERN_TYPE_TAG = 61

§

EXTERN_IDX_FUNC = 62

§

EXTERN_IDX_TABLE = 63

§

EXTERN_IDX_MEMORY = 64

§

EXTERN_IDX_GLOBAL = 65

§

EXTERN_IDX_TAG = 66

§

INDEX = 67

§

LOCAL = 68

§

MEM_PAGE_SIZE = 69

§

MEM_USE = 70

§

OFFSET = 71

§

ELEM = 72

§

ELEM_LIST = 73

§

ELEM_EXPR = 74

§

TABLE_USE = 75

§

DATA = 76

§

MODULE = 77

§

MODULE_FIELD_DATA = 78

§

MODULE_FIELD_ELEM = 79

§

MODULE_FIELD_EXPORT = 80

§

MODULE_FIELD_FUNC = 81

§

MODULE_FIELD_GLOBAL = 82

§

MODULE_FIELD_IMPORT = 83

§

MODULE_FIELD_MEMORY = 84

§

MODULE_FIELD_START = 85

§

MODULE_FIELD_TABLE = 86

§

MODULE_FIELD_TAG = 87

§

TYPE_DEF = 88

§

REC_TYPE = 89

§

ROOT = 90

Implementations§

Source§

impl SyntaxKind

Source

pub fn is_trivia(self) -> bool

Checks if it is whitespace or comment or annotation.

Source

pub fn is_comment(self) -> bool

Source

pub fn is_punc(self) -> bool

Checks if it is punctuation.

Trait Implementations§

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 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 SyntaxKindMatch for SyntaxKind

Source§

fn matches(&self, kind: SyntaxKind) -> bool

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<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.