Skip to main content

NimElementType

Enum NimElementType 

Source
#[repr(u8)]
pub enum NimElementType {
Show 129 variants Whitespace = 0, Newline = 1, CommentToken = 2, AddrKeyword = 3, AndKeyword = 4, AsKeyword = 5, AsmKeyword = 6, BindKeyword = 7, BlockKeyword = 8, BreakKeyword = 9, CaseKeyword = 10, CastKeyword = 11, ConceptKeyword = 12, ConstKeyword = 13, ContinueKeyword = 14, ConverterKeyword = 15, DeferKeyword = 16, DiscardKeyword = 17, DistinctKeyword = 18, DivKeyword = 19, DoKeyword = 20, ElifKeyword = 21, ElseKeyword = 22, EndKeyword = 23, EnumKeyword = 24, ExceptKeyword = 25, ExportKeyword = 26, FinallyKeyword = 27, ForKeyword = 28, FromKeyword = 29, FuncKeyword = 30, IfKeyword = 31, ImportKeyword = 32, InKeyword = 33, IncludeKeyword = 34, InterfaceKeyword = 35, IsKeyword = 36, IteratorKeyword = 37, LetKeyword = 38, MacroKeyword = 39, MethodKeyword = 40, MixinKeyword = 41, ModKeyword = 42, NilKeyword = 43, NotKeyword = 44, NotnilKeyword = 45, ObjectKeyword = 46, OfKeyword = 47, OrKeyword = 48, OutKeyword = 49, ProcKeyword = 50, PtrKeyword = 51, RaiseKeyword = 52, RefKeyword = 53, ReturnKeyword = 54, ShlKeyword = 55, ShrKeyword = 56, StaticKeyword = 57, TemplateKeyword = 58, TryKeyword = 59, TupleKeyword = 60, TypeKeyword = 61, UsingKeyword = 62, VarKeyword = 63, WhenKeyword = 64, WhileKeyword = 65, XorKeyword = 66, YieldKeyword = 67, Plus = 68, Minus = 69, Star = 70, Slash = 71, Percent = 72, Equal = 73, EqualEqual = 74, NotEqual = 75, Less = 76, LessEqual = 77, Greater = 78, GreaterEqual = 79, Ampersand = 80, Pipe = 81, Caret = 82, Tilde = 83, LeftShift = 84, RightShift = 85, DotDot = 86, Arrow = 87, At = 88, LeftParen = 89, RightParen = 90, LeftBracket = 91, RightBracket = 92, LeftBrace = 93, RightBrace = 94, Comma = 95, Semicolon = 96, Colon = 97, Dot = 98, Question = 99, Exclamation = 100, Dollar = 101, Backtick = 102, IntLiteral = 103, FloatLiteral = 104, StringLiteral = 105, CharLiteral = 106, BoolLiteral = 107, Identifier = 108, Root = 109, ProcDecl = 110, VarDecl = 111, LetDecl = 112, ConstDecl = 113, TypeDecl = 114, IfStmt = 115, WhileStmt = 116, ForStmt = 117, CaseStmt = 118, WhenStmt = 119, StaticStmt = 120, BlockStmt = 121, Expression = 122, Literal = 123, Comment = 124, ImportDecl = 125, ErrorNode = 126, Error = 127, Eof = 128,
}
Expand description

Element types for the Nim language.

Variants§

§

Whitespace = 0

Whitespace characters.

§

Newline = 1

A newline character.

§

CommentToken = 2

A comment token.

§

AddrKeyword = 3

The addr keyword.

§

AndKeyword = 4

The and keyword.

§

AsKeyword = 5

The as keyword.

§

AsmKeyword = 6

The asm keyword.

§

BindKeyword = 7

The bind keyword.

§

BlockKeyword = 8

The block keyword.

§

BreakKeyword = 9

The break keyword.

§

CaseKeyword = 10

The case keyword.

§

CastKeyword = 11

The cast keyword.

§

ConceptKeyword = 12

The concept keyword.

§

ConstKeyword = 13

The const keyword.

§

ContinueKeyword = 14

The continue keyword.

§

ConverterKeyword = 15

The converter keyword.

§

DeferKeyword = 16

The defer keyword.

§

DiscardKeyword = 17

The discard keyword.

§

DistinctKeyword = 18

The distinct keyword.

§

DivKeyword = 19

The div keyword.

§

DoKeyword = 20

The do keyword.

§

ElifKeyword = 21

The elif keyword.

§

ElseKeyword = 22

The else keyword.

§

EndKeyword = 23

The end keyword.

§

EnumKeyword = 24

The enum keyword.

§

ExceptKeyword = 25

The except keyword.

§

ExportKeyword = 26

The export keyword.

§

FinallyKeyword = 27

The finally keyword.

§

ForKeyword = 28

The for keyword.

§

FromKeyword = 29

The from keyword.

§

FuncKeyword = 30

The func keyword.

§

IfKeyword = 31

The if keyword.

§

ImportKeyword = 32

The import keyword.

§

InKeyword = 33

The in keyword.

§

IncludeKeyword = 34

The include keyword.

§

InterfaceKeyword = 35

The interface keyword.

§

IsKeyword = 36

The is keyword.

§

IteratorKeyword = 37

The iterator keyword.

§

LetKeyword = 38

The let keyword.

§

MacroKeyword = 39

The macro keyword.

§

MethodKeyword = 40

The method keyword.

§

MixinKeyword = 41

The mixin keyword.

§

ModKeyword = 42

The mod keyword.

§

NilKeyword = 43

The nil keyword.

§

NotKeyword = 44

The not keyword.

§

NotnilKeyword = 45

The notnil keyword.

§

ObjectKeyword = 46

The object keyword.

§

OfKeyword = 47

The of keyword.

§

OrKeyword = 48

The or keyword.

§

OutKeyword = 49

The out keyword.

§

ProcKeyword = 50

The proc keyword.

§

PtrKeyword = 51

The ptr keyword.

§

RaiseKeyword = 52

The raise keyword.

§

RefKeyword = 53

The ref keyword.

§

ReturnKeyword = 54

The return keyword.

§

ShlKeyword = 55

The shl keyword.

§

ShrKeyword = 56

The shr keyword.

§

StaticKeyword = 57

The static keyword.

§

TemplateKeyword = 58

The template keyword.

§

TryKeyword = 59

The try keyword.

§

TupleKeyword = 60

The tuple keyword.

§

TypeKeyword = 61

The type keyword.

§

UsingKeyword = 62

The using keyword.

§

VarKeyword = 63

The var keyword.

§

WhenKeyword = 64

The when keyword.

§

WhileKeyword = 65

The while keyword.

§

XorKeyword = 66

The xor keyword.

§

YieldKeyword = 67

The yield keyword.

§

Plus = 68

The + operator.

§

Minus = 69

The - operator.

§

Star = 70

The * operator.

§

Slash = 71

The / operator.

§

Percent = 72

The % operator.

§

Equal = 73

The = operator.

§

EqualEqual = 74

The == operator.

§

NotEqual = 75

The != operator.

§

Less = 76

The < operator.

§

LessEqual = 77

The <= operator.

§

Greater = 78

The > operator.

§

GreaterEqual = 79

The >= operator.

§

Ampersand = 80

The & operator.

§

Pipe = 81

The | operator.

§

Caret = 82

The ^ operator.

§

Tilde = 83

The ~ operator.

§

LeftShift = 84

The << operator.

§

RightShift = 85

The >> operator.

§

DotDot = 86

The .. operator.

§

Arrow = 87

The -> operator.

§

At = 88

The @ operator.

§

LeftParen = 89

An opening parenthesis (.

§

RightParen = 90

A closing parenthesis ).

§

LeftBracket = 91

An opening bracket [.

§

RightBracket = 92

A closing bracket ].

§

LeftBrace = 93

An opening brace {.

§

RightBrace = 94

A closing brace }.

§

Comma = 95

A comma ,.

§

Semicolon = 96

A semicolon ;.

§

Colon = 97

A colon :.

§

Dot = 98

A dot ..

§

Question = 99

A question mark ?.

§

Exclamation = 100

An exclamation mark !.

§

Dollar = 101

A dollar sign $.

§

Backtick = 102

A backtick `.

§

IntLiteral = 103

An integer literal.

§

FloatLiteral = 104

A floating-point literal.

§

StringLiteral = 105

A string literal.

§

CharLiteral = 106

A character literal.

§

BoolLiteral = 107

A boolean literal.

§

Identifier = 108

An identifier.

§

Root = 109

Root node of the AST.

§

ProcDecl = 110

Procedure declaration.

§

VarDecl = 111

Variable declaration.

§

LetDecl = 112

Let declaration.

§

ConstDecl = 113

Constant declaration.

§

TypeDecl = 114

Type declaration.

§

IfStmt = 115

If statement.

§

WhileStmt = 116

While statement.

§

ForStmt = 117

For statement.

§

CaseStmt = 118

Case statement.

§

WhenStmt = 119

When statement (compile-time).

§

StaticStmt = 120

Static statement (compile-time).

§

BlockStmt = 121

Block statement.

§

Expression = 122

An expression.

§

Literal = 123

A literal.

§

Comment = 124

A comment.

§

ImportDecl = 125

Import declaration.

§

ErrorNode = 126

An error node in the AST.

§

Error = 127

An error element.

§

Eof = 128

End of stream.

Implementations§

Source§

impl NimElementType

Source

pub fn is_token(&self) -> bool

Returns true if the element type is a token.

Source

pub fn is_element(&self) -> bool

Returns true if the element type is a non-terminal element.

Trait Implementations§

Source§

impl Clone for NimElementType

Source§

fn clone(&self) -> NimElementType

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 NimElementType

Source§

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

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

impl<'de> Deserialize<'de> for NimElementType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl ElementType for NimElementType

Source§

type Role = UniversalElementRole

The associated role type for this element kind.
Source§

fn role(&self) -> Self::Role

Returns the general syntactic role of this element. Read more
Source§

fn is_role(&self, role: Self::Role) -> bool

Returns true if this element matches the specified language-specific role.
Source§

fn is_universal(&self, role: UniversalElementRole) -> bool

Returns true if this element matches the specified universal role.
Source§

fn is_root(&self) -> bool

Returns true if this element represents the root of the parsed tree.
Source§

fn is_error(&self) -> bool

Returns true if this element represents an error condition.
Source§

impl From<NimTokenType> for NimElementType

Source§

fn from(token: NimTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for NimElementType

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 PartialEq for NimElementType

Source§

fn eq(&self, other: &NimElementType) -> 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 Serialize for NimElementType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for NimElementType

Source§

impl Eq for NimElementType

Source§

impl StructuralPartialEq for NimElementType

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,