Skip to main content

RubyElementType

Enum RubyElementType 

Source
#[repr(u8)]
pub enum RubyElementType {
Show 142 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, Not = 44, In = 45, True = 46, False = 47, Nil = 48, Super = 49, Self_ = 50, Alias = 51, Undef = 52, Defined = 53, Do = 54, Plus = 55, Minus = 56, Multiply = 57, Divide = 58, Modulo = 59, Power = 60, EqualEqual = 61, NotEqual = 62, Less = 63, Greater = 64, LessEqual = 65, GreaterEqual = 66, EqualEqualEqual = 67, Spaceship = 68, Assign = 69, PlusAssign = 70, MinusAssign = 71, MultiplyAssign = 72, DivideAssign = 73, ModuloAssign = 74, PowerAssign = 75, BitAnd = 76, BitOr = 77, Xor = 78, LogicalNot = 79, Tilde = 80, LeftShift = 81, RightShift = 82, AndAssign = 83, OrAssign = 84, XorAssign = 85, LeftShiftAssign = 86, RightShiftAssign = 87, AndAnd = 88, OrOr = 89, OrOrAssign = 90, AndAndAssign = 91, Question = 92, DotDot = 93, DotDotDot = 94, Match = 95, NotMatch = 96, LeftParen = 97, RightParen = 98, LeftBracket = 99, RightBracket = 100, LeftBrace = 101, RightBrace = 102, Comma = 103, Colon = 104, Semicolon = 105, Dot = 106, DoubleColon = 107, At = 108, Dollar = 109, Whitespace = 110, Newline = 111, Comment = 112, Eof = 113, Invalid = 114, Root = 115, BinaryExpression = 116, UnaryExpression = 117, LiteralExpression = 118, ParenExpression = 119, ParenthesizedExpression = 120, MethodDefinition = 121, ClassDefinition = 122, ModuleDefinition = 123, IfStatement = 124, WhileStatement = 125, UnlessStatement = 126, UntilStatement = 127, ForStatement = 128, CaseStatement = 129, WhenClause = 130, BeginStatement = 131, RescueClause = 132, EnsureClause = 133, ReturnStatement = 134, IfExpression = 135, CallExpression = 136, MemberAccess = 137, ParameterList = 138, ArgumentList = 139, Error = 140, Equal = 141,
}
Expand description

Element types for Ruby.

Variants§

§

Identifier = 0

An identifier.

§

GlobalVariable = 1

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

§

InstanceVariable = 2

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

§

ClassVariable = 3

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

§

Constant = 4

A constant (e.g., MATH).

§

IntegerLiteral = 5

An integer literal.

§

FloatLiteral = 6

A float literal.

§

StringLiteral = 7

A string literal.

§

Literal = 8

A general literal.

§

Symbol = 9

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

§

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.

§

Not = 44

The not keyword.

§

In = 45

The in keyword.

§

True = 46

The true keyword.

§

False = 47

The false keyword.

§

Nil = 48

The nil keyword.

§

Super = 49

The super keyword.

§

Self_ = 50

The self keyword.

§

Alias = 51

The alias keyword.

§

Undef = 52

The undef keyword.

§

Defined = 53

The defined? keyword.

§

Do = 54

The do keyword.

§

Plus = 55

Plus operator +.

§

Minus = 56

Minus operator -.

§

Multiply = 57

Multiply operator *.

§

Divide = 58

Divide operator /.

§

Modulo = 59

Modulo operator %.

§

Power = 60

Power operator **.

§

EqualEqual = 61

Equality operator ==.

§

NotEqual = 62

Inequality operator !=.

§

Less = 63

Less than operator <.

§

Greater = 64

Greater than operator >.

§

LessEqual = 65

Less than or equal operator <=.

§

GreaterEqual = 66

Greater than or equal operator >=.

§

EqualEqualEqual = 67

Case equality operator ===.

§

Spaceship = 68

Spaceship operator <=>.

§

Assign = 69

Assignment operator =.

§

PlusAssign = 70

Plus assignment operator +=.

§

MinusAssign = 71

Minus assignment operator -=.

§

MultiplyAssign = 72

Multiply assignment operator *=.

§

DivideAssign = 73

Divide assignment operator /=.

§

ModuloAssign = 74

Modulo assignment operator %=.

§

PowerAssign = 75

Power assignment operator **=.

§

BitAnd = 76

Bitwise AND operator &.

§

BitOr = 77

Bitwise OR operator |.

§

Xor = 78

Bitwise XOR operator ^.

§

LogicalNot = 79

Logical NOT operator !.

§

Tilde = 80

Bitwise NOT operator ~.

§

LeftShift = 81

Left shift operator <<.

§

RightShift = 82

Right shift operator >>.

§

AndAssign = 83

AND assignment operator &=.

§

OrAssign = 84

OR assignment operator |=.

§

XorAssign = 85

XOR assignment operator ^=.

§

LeftShiftAssign = 86

Left shift assignment operator <<=.

§

RightShiftAssign = 87

Right shift assignment operator >>=.

§

AndAnd = 88

Logical AND operator &&.

§

OrOr = 89

Logical OR operator ||.

§

OrOrAssign = 90

OR OR assignment operator ||=.

§

AndAndAssign = 91

AND AND assignment operator &&=.

§

Question = 92

Question mark ?.

§

DotDot = 93

Range operator ...

§

DotDotDot = 94

Range operator ....

§

Match = 95

Match operator =~.

§

NotMatch = 96

Not match operator !~.

§

LeftParen = 97

Left parenthesis (.

§

RightParen = 98

Right parenthesis ).

§

LeftBracket = 99

Left bracket [.

§

RightBracket = 100

Right bracket ].

§

LeftBrace = 101

Left brace {.

§

RightBrace = 102

Right brace }.

§

Comma = 103

Comma ,.

§

Colon = 104

Colon :.

§

Semicolon = 105

Semicolon ;.

§

Dot = 106

Dot ..

§

DoubleColon = 107

Double colon ::.

§

At = 108

At symbol @.

§

Dollar = 109

Dollar sign $.

§

Whitespace = 110

Whitespace.

§

Newline = 111

Newline.

§

Comment = 112

Comment.

§

Eof = 113

End of file.

§

Invalid = 114

Invalid token.

§

Root = 115

Root element.

§

BinaryExpression = 116

A binary expression.

§

UnaryExpression = 117

A unary expression.

§

LiteralExpression = 118

A literal expression.

§

ParenExpression = 119

A parenthesized expression.

§

ParenthesizedExpression = 120

A parenthesized expression (alternative).

§

MethodDefinition = 121

A method definition.

§

ClassDefinition = 122

A class definition.

§

ModuleDefinition = 123

A module definition.

§

IfStatement = 124

An if statement.

§

WhileStatement = 125

A while statement.

§

UnlessStatement = 126

An unless statement.

§

UntilStatement = 127

An until statement.

§

ForStatement = 128

A for statement.

§

CaseStatement = 129

A case statement.

§

WhenClause = 130

A when clause.

§

BeginStatement = 131

A begin statement.

§

RescueClause = 132

A rescue clause.

§

EnsureClause = 133

An ensure clause.

§

ReturnStatement = 134

A return statement.

§

IfExpression = 135

An if expression.

§

CallExpression = 136

A call expression.

§

MemberAccess = 137

A member access expression.

§

ParameterList = 138

A parameter list.

§

ArgumentList = 139

An argument list.

§

Error = 140

An error element.

§

Equal = 141

Equal operator =.

Implementations§

Source§

impl RubyElementType

Source

pub fn is_ignored(&self) -> bool

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

Source

pub fn is_keyword(&self) -> bool

Returns true if the element is a keyword.

Trait Implementations§

Source§

impl Clone for RubyElementType

Source§

fn clone(&self) -> RubyElementType

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 RubyElementType

Source§

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

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

impl<'de> Deserialize<'de> for RubyElementType

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 RubyElementType

Source§

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

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

impl ElementType for RubyElementType

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.
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<RubyTokenType> for RubyElementType

Source§

fn from(token: RubyTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for RubyElementType

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 RubyElementType

Source§

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

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 RubyElementType

Source§

impl Eq for RubyElementType

Source§

impl StructuralPartialEq for RubyElementType

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