Skip to main content

RElementType

Enum RElementType 

Source
#[repr(u8)]
pub enum RElementType {
Show 89 variants Whitespace = 0, Newline = 1, Comment = 2, StringLiteral = 3, IntegerLiteral = 4, FloatLiteral = 5, BooleanLiteral = 6, NullLiteral = 7, Inf = 8, NaN = 9, NA = 10, NaInteger = 11, NaReal = 12, NaComplex = 13, NaCharacter = 14, Identifier = 15, If = 16, Else = 17, For = 18, In = 19, While = 20, Repeat = 21, Next = 22, Break = 23, Function = 24, Return = 25, True = 26, False = 27, Null = 28, Plus = 29, Minus = 30, Star = 31, Slash = 32, Percent = 33, Caret = 34, Equal = 35, EqualEqual = 36, NotEqual = 37, Less = 38, Greater = 39, LessEqual = 40, GreaterEqual = 41, And = 42, Or = 43, Not = 44, AndAnd = 45, OrOr = 46, Tilde = 47, LeftArrow = 48, RightArrow = 49, DoubleLeftArrow = 50, DoubleRightArrow = 51, Pipe = 52, Operator = 53, LeftParen = 54, RightParen = 55, LeftBracket = 56, RightBracket = 57, LeftBrace = 58, RightBrace = 59, Comma = 60, Semicolon = 61, Colon = 62, DoubleColon = 63, TripleColon = 64, Dot = 65, Dollar = 66, At = 67, Question = 68, Root = 69, Assignment = 70, BinaryExpression = 71, UnaryExpression = 72, LiteralExpression = 73, IdentifierExpression = 74, CallExpression = 75, GroupingExpression = 76, BlockExpression = 77, IfExpression = 78, WhileExpression = 79, ForExpression = 80, RepeatExpression = 81, FunctionDefinition = 82, IndexExpression = 83, MemberExpression = 84, ArgumentList = 85, ParameterList = 86, Error = 87, Eof = 88,
}
Expand description

Element types for the R language parser.

Variants§

§

Whitespace = 0

Whitespace.

§

Newline = 1

Newline.

§

Comment = 2

Comment.

§

StringLiteral = 3

String literal.

§

IntegerLiteral = 4

Integer literal.

§

FloatLiteral = 5

Float literal.

§

BooleanLiteral = 6

Boolean literal.

§

NullLiteral = 7

Null literal.

§

Inf = 8

Infinity.

§

NaN = 9

Not a Number.

§

NA = 10

Not Available.

§

NaInteger = 11

Not Available (Integer).

§

NaReal = 12

Not Available (Real).

§

NaComplex = 13

Not Available (Complex).

§

NaCharacter = 14

Not Available (Character).

§

Identifier = 15

Identifier.

§

If = 16

if keyword.

§

Else = 17

else keyword.

§

For = 18

for keyword.

§

In = 19

in keyword.

§

While = 20

while keyword.

§

Repeat = 21

repeat keyword.

§

Next = 22

next keyword.

§

Break = 23

break keyword.

§

Function = 24

function keyword.

§

Return = 25

return keyword.

§

True = 26

TRUE keyword.

§

False = 27

FALSE keyword.

§

Null = 28

NULL keyword.

§

Plus = 29

+ operator.

§

Minus = 30

- operator.

§

Star = 31

* operator.

§

Slash = 32

/ operator.

§

Percent = 33

% operator.

§

Caret = 34

^ operator.

§

Equal = 35

= operator.

§

EqualEqual = 36

== operator.

§

NotEqual = 37

!= operator.

§

Less = 38

< operator.

§

Greater = 39

> operator.

§

LessEqual = 40

<= operator.

§

GreaterEqual = 41

>= operator.

§

And = 42

& operator.

§

Or = 43

| operator.

§

Not = 44

! operator.

§

AndAnd = 45

&& operator.

§

OrOr = 46

|| operator.

§

Tilde = 47

~ operator.

§

LeftArrow = 48

<- operator.

§

RightArrow = 49

-> operator.

§

DoubleLeftArrow = 50

<<- operator.

§

DoubleRightArrow = 51

->> operator.

§

Pipe = 52

|> operator.

§

Operator = 53

Custom operator.

§

LeftParen = 54

( symbol.

§

RightParen = 55

) symbol.

§

LeftBracket = 56

[ symbol.

§

RightBracket = 57

] symbol.

§

LeftBrace = 58

{ symbol.

§

RightBrace = 59

} symbol.

§

Comma = 60

, symbol.

§

Semicolon = 61

; symbol.

§

Colon = 62

: symbol.

§

DoubleColon = 63

:: symbol.

§

TripleColon = 64

::: symbol.

§

Dot = 65

. symbol.

§

Dollar = 66

$ symbol.

§

At = 67

@ symbol.

§

Question = 68

? symbol.

§

Root = 69

Root node.

§

Assignment = 70

Assignment expression.

§

BinaryExpression = 71

Binary expression.

§

UnaryExpression = 72

Unary expression.

§

LiteralExpression = 73

Literal expression.

§

IdentifierExpression = 74

Identifier expression.

§

CallExpression = 75

Call expression.

§

GroupingExpression = 76

Grouping expression.

§

BlockExpression = 77

Block expression.

§

IfExpression = 78

If expression.

§

WhileExpression = 79

While expression.

§

ForExpression = 80

For expression.

§

RepeatExpression = 81

Repeat expression.

§

FunctionDefinition = 82

Function definition.

§

IndexExpression = 83

Index expression.

§

MemberExpression = 84

Member expression.

§

ArgumentList = 85

Argument list.

§

ParameterList = 86

Parameter list.

§

Error = 87

Error token.

§

Eof = 88

End of file token.

Implementations§

Source§

impl RElementType

Source

pub fn is_trivia(self) -> bool

Returns true if this element type is trivia (whitespace, newline, or comment).

Trait Implementations§

Source§

impl Clone for RElementType

Source§

fn clone(&self) -> RElementType

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 RElementType

Source§

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

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

impl<'de> Deserialize<'de> for RElementType

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 RElementType

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<RTokenType> for RElementType

Source§

fn from(token: RTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for RElementType

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 RElementType

Source§

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

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 RElementType

Source§

impl Eq for RElementType

Source§

impl StructuralPartialEq for RElementType

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