Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
pub enum SyntaxKind {
Show 159 variants OR, NULL_COAELSE, AND, BIT_OR, BIT_XOR, BIT_AND, EQ, NE, LT, GT, LE, GE, LHS, RHS, PLUS, MINUS, MUL, DIV, MODULO, NOT, BIT_NOT, L_BRACK, R_BRACK, L_PAREN, R_PAREN, L_BRACE, R_BRACE, COLON, SEMI, DOT, DOTDOTDOT, COMMA, DOLLAR, ASSIGN, QUESTION_MARK, FLOAT, ERROR_FLOAT_JUNK_AFTER_POINT, ERROR_FLOAT_JUNK_AFTER_EXPONENT, ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN, STRING_DOUBLE, ERROR_STRING_DOUBLE_UNTERMINATED, STRING_SINGLE, ERROR_STRING_SINGLE_UNTERMINATED, STRING_DOUBLE_VERBATIM, ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED, STRING_SINGLE_VERBATIM, ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED, ERROR_STRING_VERBATIM_MISSING_QUOTES, STRING_BLOCK, ERROR_STRING_BLOCK_UNEXPECTED_END, ERROR_STRING_BLOCK_MISSING_NEW_LINE, ERROR_STRING_BLOCK_MISSING_TERMINATION, ERROR_STRING_BLOCK_MISSING_INDENT, IDENT, WHITESPACE, SINGLE_LINE_SLASH_COMMENT, SINGLE_LINE_HASH_COMMENT, MULTI_LINE_COMMENT, ERROR_COMMENT_TOO_SHORT, ERROR_COMMENT_UNTERMINATED, ERROR_NO_OPERATOR, ERROR_MISSING_TOKEN, ERROR_UNEXPECTED_TOKEN, ERROR_CUSTOM, TAILSTRICT_KW, LOCAL_KW, IMPORTSTR_KW, IMPORTBIN_KW, IMPORT_KW, IF_KW, THEN_KW, ELSE_KW, FUNCTION_KW, ERROR_KW, IN_KW, META_OBJECT_APPLY, NULL_KW, TRUE_KW, FALSE_KW, SELF_KW, SUPER_KW, FOR_KW, ASSERT_KW, LEXING_ERROR, __LAST_TOKEN, SOURCE_FILE, EXPR, SUFFIX_INDEX, NAME, SUFFIX_INDEX_EXPR, SUFFIX_SLICE, SLICE_DESC, SUFFIX_APPLY, ARGS_DESC, STMT_LOCAL, STMT_ASSERT, ASSERTION, EXPR_BINARY, EXPR_UNARY, EXPR_OBJ_EXTEND, EXPR_PARENED, EXPR_LITERAL, EXPR_STRING, EXPR_NUMBER, EXPR_ARRAY, EXPR_OBJECT, EXPR_ARRAY_COMP, EXPR_IMPORT, EXPR_VAR, EXPR_IF_THEN_ELSE, TRUE_EXPR, FALSE_EXPR, EXPR_FUNCTION, PARAMS_DESC, EXPR_ERROR, SLICE_DESC_END, SLICE_DESC_STEP, ARG, OBJ_BODY_COMP, OBJ_BODY_MEMBER_LIST, MEMBER_BIND_STMT, OBJ_LOCAL, MEMBER_ASSERT_STMT, MEMBER_FIELD_NORMAL, VISIBILITY, MEMBER_FIELD_METHOD, FIELD_NAME_FIXED, FIELD_NAME_DYNAMIC, FOR_SPEC, IF_SPEC, BIND_DESTRUCT, BIND_FUNCTION, PARAM, DESTRUCT_FULL, DESTRUCT_SKIP, DESTRUCT_ARRAY, DESTRUCT_OBJECT, DESTRUCT_OBJECT_FIELD, DESTRUCT_REST, DESTRUCT_ARRAY_ELEMENT, SUFFIX, BIND, STMT, OBJ_BODY, COMP_SPEC, EXPR_BASE, MEMBER_COMP, MEMBER, FIELD_NAME, DESTRUCT, DESTRUCT_ARRAY_PART, BINARY_OPERATOR, UNARY_OPERATOR, LITERAL, TEXT, NUMBER, IMPORT_KIND, TRIVIA, CUSTOM_ERROR, // some variants omitted
}
Expand description

The kind of syntax node, e.g. IDENT, USE_KW, or STRUCT.

Variants§

§

OR

§

NULL_COAELSE

§

AND

§

BIT_OR

§

BIT_XOR

§

BIT_AND

§

EQ

§

NE

§

LT

§

GT

§

LE

§

GE

§

LHS

§

RHS

§

PLUS

§

MINUS

§

MUL

§

DIV

§

MODULO

§

NOT

§

BIT_NOT

§

L_BRACK

§

R_BRACK

§

L_PAREN

§

R_PAREN

§

L_BRACE

§

R_BRACE

§

COLON

§

SEMI

§

DOT

§

DOTDOTDOT

§

COMMA

§

DOLLAR

§

ASSIGN

§

QUESTION_MARK

§

FLOAT

§

ERROR_FLOAT_JUNK_AFTER_POINT

§

ERROR_FLOAT_JUNK_AFTER_EXPONENT

§

ERROR_FLOAT_JUNK_AFTER_EXPONENT_SIGN

§

STRING_DOUBLE

§

ERROR_STRING_DOUBLE_UNTERMINATED

§

STRING_SINGLE

§

ERROR_STRING_SINGLE_UNTERMINATED

§

STRING_DOUBLE_VERBATIM

§

ERROR_STRING_DOUBLE_VERBATIM_UNTERMINATED

§

STRING_SINGLE_VERBATIM

§

ERROR_STRING_SINGLE_VERBATIM_UNTERMINATED

§

ERROR_STRING_VERBATIM_MISSING_QUOTES

§

STRING_BLOCK

§

ERROR_STRING_BLOCK_UNEXPECTED_END

§

ERROR_STRING_BLOCK_MISSING_NEW_LINE

§

ERROR_STRING_BLOCK_MISSING_TERMINATION

§

ERROR_STRING_BLOCK_MISSING_INDENT

§

IDENT

§

WHITESPACE

§

SINGLE_LINE_SLASH_COMMENT

§

SINGLE_LINE_HASH_COMMENT

§

MULTI_LINE_COMMENT

§

ERROR_COMMENT_TOO_SHORT

§

ERROR_COMMENT_UNTERMINATED

§

ERROR_NO_OPERATOR

§

ERROR_MISSING_TOKEN

§

ERROR_UNEXPECTED_TOKEN

§

ERROR_CUSTOM

§

TAILSTRICT_KW

§

LOCAL_KW

§

IMPORTSTR_KW

§

IMPORTBIN_KW

§

IMPORT_KW

§

IF_KW

§

THEN_KW

§

ELSE_KW

§

FUNCTION_KW

§

ERROR_KW

§

IN_KW

§

META_OBJECT_APPLY

§

NULL_KW

§

TRUE_KW

§

FALSE_KW

§

SELF_KW

§

SUPER_KW

§

FOR_KW

§

ASSERT_KW

§

LEXING_ERROR

§

__LAST_TOKEN

§

SOURCE_FILE

§

EXPR

§

SUFFIX_INDEX

§

NAME

§

SUFFIX_INDEX_EXPR

§

SUFFIX_SLICE

§

SLICE_DESC

§

SUFFIX_APPLY

§

ARGS_DESC

§

STMT_LOCAL

§

STMT_ASSERT

§

ASSERTION

§

EXPR_BINARY

§

EXPR_UNARY

§

EXPR_OBJ_EXTEND

§

EXPR_PARENED

§

EXPR_LITERAL

§

EXPR_STRING

§

EXPR_NUMBER

§

EXPR_ARRAY

§

EXPR_OBJECT

§

EXPR_ARRAY_COMP

§

EXPR_IMPORT

§

EXPR_VAR

§

EXPR_IF_THEN_ELSE

§

TRUE_EXPR

§

FALSE_EXPR

§

EXPR_FUNCTION

§

PARAMS_DESC

§

EXPR_ERROR

§

SLICE_DESC_END

§

SLICE_DESC_STEP

§

ARG

§

OBJ_BODY_COMP

§

OBJ_BODY_MEMBER_LIST

§

MEMBER_BIND_STMT

§

OBJ_LOCAL

§

MEMBER_ASSERT_STMT

§

MEMBER_FIELD_NORMAL

§

VISIBILITY

§

MEMBER_FIELD_METHOD

§

FIELD_NAME_FIXED

§

FIELD_NAME_DYNAMIC

§

FOR_SPEC

§

IF_SPEC

§

BIND_DESTRUCT

§

BIND_FUNCTION

§

PARAM

§

DESTRUCT_FULL

§

DESTRUCT_SKIP

§

DESTRUCT_ARRAY

§

DESTRUCT_OBJECT

§

DESTRUCT_OBJECT_FIELD

§

DESTRUCT_REST

§

DESTRUCT_ARRAY_ELEMENT

§

SUFFIX

§

BIND

§

STMT

§

OBJ_BODY

§

COMP_SPEC

§

EXPR_BASE

§

MEMBER_COMP

§

MEMBER

§

FIELD_NAME

§

DESTRUCT

§

DESTRUCT_ARRAY_PART

§

BINARY_OPERATOR

§

UNARY_OPERATOR

§

LITERAL

§

TEXT

§

NUMBER

§

IMPORT_KIND

§

TRIVIA

§

CUSTOM_ERROR

Implementations§

Source§

impl SyntaxKind

Source

pub fn is_keyword(self) -> bool

Source

pub fn is_enum(self) -> bool

Source

pub fn error_description(self) -> Option<&'static str>

Source

pub fn display_name(self) -> &'static str

Source

pub fn from_raw(r: u16) -> Self

Source

pub fn into_raw(self) -> u16

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