Skip to main content

RubyTokenType

Enum RubyTokenType 

Source
#[repr(u8)]
pub enum RubyTokenType {
Show 135 variants Identifier = 0, GlobalVariable = 1, InstanceVariable = 2, ClassVariable = 3, Constant = 4, IntegerLiteral = 5, FloatLiteral = 6, StringLiteral = 7, Literal = 8, Symbol = 9, RegexLiteral = 10, If = 11, Unless = 12, Elsif = 13, Else = 14, Case = 15, When = 16, Then = 17, For = 18, While = 19, Until = 20, Break = 21, Next = 22, Redo = 23, Retry = 24, Return = 25, Yield = 26, Def = 27, Class = 28, Module = 29, End = 30, Lambda = 31, Proc = 32, Begin = 33, Rescue = 34, Ensure = 35, Raise = 36, Require = 37, Load = 38, Include = 39, Extend = 40, Prepend = 41, And = 42, Or = 43, EqualGreater = 44, Not = 45, In = 46, True = 47, False = 48, Nil = 49, Super = 50, Self_ = 51, Alias = 52, Undef = 53, Defined = 54, Do = 55, Plus = 56, Minus = 57, Multiply = 58, Divide = 59, Modulo = 60, Power = 61, EqualEqual = 62, NotEqual = 63, Less = 64, Greater = 65, LessEqual = 66, GreaterEqual = 67, EqualEqualEqual = 68, Spaceship = 69, Assign = 70, PlusAssign = 71, MinusAssign = 72, MultiplyAssign = 73, DivideAssign = 74, ModuloAssign = 75, PowerAssign = 76, BitAnd = 77, BitOr = 78, Xor = 79, LogicalNot = 80, Tilde = 81, LeftShift = 82, RightShift = 83, AndAssign = 84, OrAssign = 85, XorAssign = 86, LeftShiftAssign = 87, RightShiftAssign = 88, AndAnd = 89, OrOr = 90, OrOrAssign = 91, AndAndAssign = 92, Question = 93, DotDot = 94, DotDotDot = 95, Match = 96, NotMatch = 97, LeftParen = 98, RightParen = 99, LeftBracket = 100, RightBracket = 101, LeftBrace = 102, RightBrace = 103, Comma = 104, Colon = 105, Semicolon = 106, Dot = 107, DoubleColon = 108, At = 109, Dollar = 110, Whitespace = 111, Newline = 112, Comment = 113, Eof = 114, Invalid = 115, Root = 116, BinaryExpression = 117, UnaryExpression = 118, LiteralExpression = 119, ParenExpression = 120, ParenthesizedExpression = 121, MethodDefinition = 122, ClassDefinition = 123, ModuleDefinition = 124, IfStatement = 125, WhileStatement = 126, ReturnStatement = 127, IfExpression = 128, CallExpression = 129, MemberAccess = 130, ParameterList = 131, ArgumentList = 132, Error = 133, Equal = 134,
}
Expand description

Token types for Ruby.

Variants§

§

Identifier = 0

An identifier.

§

GlobalVariable = 1

A global variable (e.g., $global).

§

InstanceVariable = 2

An instance variable (e.g., @instance).

§

ClassVariable = 3

A class variable (e.g., @@class).

§

Constant = 4

A constant (e.g., CONSTANT).

§

IntegerLiteral = 5

An integer literal.

§

FloatLiteral = 6

A float literal.

§

StringLiteral = 7

A string literal.

§

Literal = 8

A literal value.

§

Symbol = 9

A symbol (e.g., :symbol).

§

RegexLiteral = 10

A regular expression literal.

§

If = 11

The if keyword.

§

Unless = 12

The unless keyword.

§

Elsif = 13

The elsif keyword.

§

Else = 14

The else keyword.

§

Case = 15

The case keyword.

§

When = 16

The when keyword.

§

Then = 17

The then keyword.

§

For = 18

The for keyword.

§

While = 19

The while keyword.

§

Until = 20

The until keyword.

§

Break = 21

The break keyword.

§

Next = 22

The next keyword.

§

Redo = 23

The redo keyword.

§

Retry = 24

The retry keyword.

§

Return = 25

The return keyword.

§

Yield = 26

The yield keyword.

§

Def = 27

The def keyword.

§

Class = 28

The class keyword.

§

Module = 29

The module keyword.

§

End = 30

The end keyword.

§

Lambda = 31

The lambda keyword.

§

Proc = 32

The proc keyword.

§

Begin = 33

The begin keyword.

§

Rescue = 34

The rescue keyword.

§

Ensure = 35

The ensure keyword.

§

Raise = 36

The raise keyword.

§

Require = 37

The require keyword.

§

Load = 38

The load keyword.

§

Include = 39

The include keyword.

§

Extend = 40

The extend keyword.

§

Prepend = 41

The prepend keyword.

§

And = 42

The and keyword.

§

Or = 43

The or keyword.

§

EqualGreater = 44

The => operator.

§

Not = 45

The not keyword.

§

In = 46

The in keyword.

§

True = 47

The true keyword.

§

False = 48

The false keyword.

§

Nil = 49

The nil keyword.

§

Super = 50

The super keyword.

§

Self_ = 51

The self keyword.

§

Alias = 52

The alias keyword.

§

Undef = 53

The undef keyword.

§

Defined = 54

The defined? keyword.

§

Do = 55

The do keyword.

§

Plus = 56

Plus operator +.

§

Minus = 57

Minus operator -.

§

Multiply = 58

Multiply operator *.

§

Divide = 59

Divide operator /.

§

Modulo = 60

Modulo operator %.

§

Power = 61

Power operator **.

§

EqualEqual = 62

Equality operator ==.

§

NotEqual = 63

Inequality operator !=.

§

Less = 64

Less than operator <.

§

Greater = 65

Greater than operator >.

§

LessEqual = 66

Less than or equal operator <=.

§

GreaterEqual = 67

Greater than or equal operator >=.

§

EqualEqualEqual = 68

Case equality operator ===.

§

Spaceship = 69

Spaceship operator <=>.

§

Assign = 70

Assignment operator =.

§

PlusAssign = 71

Addition assignment operator +=.

§

MinusAssign = 72

Subtraction assignment operator -=.

§

MultiplyAssign = 73

Multiplication assignment operator *=.

§

DivideAssign = 74

Division assignment operator /=.

§

ModuloAssign = 75

Modulo assignment operator %=.

§

PowerAssign = 76

Power assignment operator **=.

§

BitAnd = 77

Bitwise AND operator &.

§

BitOr = 78

Bitwise OR operator |.

§

Xor = 79

Bitwise XOR operator ^.

§

LogicalNot = 80

Logical NOT operator !.

§

Tilde = 81

Bitwise NOT operator ~.

§

LeftShift = 82

Left shift operator <<.

§

RightShift = 83

Right shift operator >>.

§

AndAssign = 84

Bitwise AND assignment operator &=.

§

OrAssign = 85

Bitwise OR assignment operator |=.

§

XorAssign = 86

Bitwise XOR assignment operator ^=.

§

LeftShiftAssign = 87

Left shift assignment operator <<=.

§

RightShiftAssign = 88

Right shift assignment operator >>=.

§

AndAnd = 89

Logical AND operator &&.

§

OrOr = 90

Logical OR operator ||.

§

OrOrAssign = 91

Logical OR assignment operator ||=.

§

AndAndAssign = 92

Logical AND assignment operator &&=.

§

Question = 93

Ternary operator ?.

§

DotDot = 94

Range operator ...

§

DotDotDot = 95

Exclusive range operator ....

§

Match = 96

Match operator =~.

§

NotMatch = 97

Not match operator !~.

§

LeftParen = 98

Left parenthesis (.

§

RightParen = 99

Right parenthesis ).

§

LeftBracket = 100

Left bracket [.

§

RightBracket = 101

Right bracket ].

§

LeftBrace = 102

Left brace {.

§

RightBrace = 103

Right brace }.

§

Comma = 104

Comma ,.

§

Colon = 105

Colon :.

§

Semicolon = 106

Semicolon ;.

§

Dot = 107

Dot ..

§

DoubleColon = 108

Double colon ::.

§

At = 109

At symbol @.

§

Dollar = 110

Dollar symbol $.

§

Whitespace = 111

Whitespace.

§

Newline = 112

Newline.

§

Comment = 113

A comment.

§

Eof = 114

End of file.

§

Invalid = 115

An invalid token.

§

Root = 116

The root of the syntax tree.

§

BinaryExpression = 117

A binary expression.

§

UnaryExpression = 118

A unary expression.

§

LiteralExpression = 119

A literal expression.

§

ParenExpression = 120

A parenthesized expression.

§

ParenthesizedExpression = 121

A parenthesized expression (alias).

§

MethodDefinition = 122

A method definition.

§

ClassDefinition = 123

A class definition.

§

ModuleDefinition = 124

A module definition.

§

IfStatement = 125

An if statement.

§

WhileStatement = 126

A while statement.

§

ReturnStatement = 127

A return statement.

§

IfExpression = 128

An if expression.

§

CallExpression = 129

A method call expression.

§

MemberAccess = 130

A member access expression.

§

ParameterList = 131

A list of parameters.

§

ArgumentList = 132

A list of arguments.

§

Error = 133

An error element.

§

Equal = 134

Equality operator (alias).

Implementations§

Source§

impl RubyTokenType

Source

pub fn is_ignored(&self) -> bool

Returns true if the token is ignored (whitespace, newline, or comment).

Source

pub fn is_keyword(&self) -> bool

Returns true if the token type is a keyword.

Trait Implementations§

Source§

impl Clone for RubyTokenType

Source§

fn clone(&self) -> RubyTokenType

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 RubyTokenType

Source§

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

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

impl<'de> Deserialize<'de> for RubyTokenType

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 Display for RubyTokenType

Source§

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

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

impl From<RubyTokenType> for RubyElementType

Source§

fn from(token: RubyTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for RubyTokenType

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 RubyTokenType

Source§

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

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 TokenType for RubyTokenType

Source§

const END_OF_STREAM: Self = Self::Error

A constant representing the end of the input stream.
Source§

type Role = UniversalTokenRole

The associated role type for this token kind.
Source§

fn is_ignored(&self) -> bool

Returns true if this token represents trivia (whitespace, comments, etc.).
Source§

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

Returns the general syntactic role of this token.
Source§

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

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

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

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

fn is_comment(&self) -> bool

Returns true if this token represents a comment.
Source§

fn is_whitespace(&self) -> bool

Returns true if this token represents whitespace.
Source§

fn is_error(&self) -> bool

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

fn is_end_of_stream(&self) -> bool

Returns true if this token represents the end of the input stream.
Source§

impl Copy for RubyTokenType

Source§

impl Eq for RubyTokenType

Source§

impl StructuralPartialEq for RubyTokenType

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,