Skip to main content

ErlangElementType

Enum ErlangElementType 

Source
#[repr(u8)]
pub enum ErlangElementType {
Show 93 variants Whitespace = 0, Newline = 1, Comment = 2, Identifier = 3, Atom = 4, Variable = 5, Number = 6, String = 7, Character = 8, After = 9, And = 10, Andalso = 11, Band = 12, Begin = 13, Bnot = 14, Bor = 15, Bsl = 16, Bsr = 17, Bxor = 18, Case = 19, Catch = 20, Cond = 21, Div = 22, End = 23, Fun = 24, If = 25, Let = 26, Not = 27, Of = 28, Or = 29, Orelse = 30, Query = 31, Receive = 32, Rem = 33, Try = 34, When = 35, Xor = 36, Plus = 37, Minus = 38, Star = 39, Slash = 40, Equal = 41, EqualEqual = 42, SlashEqual = 43, EqualColonEqual = 44, EqualSlashEqual = 45, Less = 46, Greater = 47, LessEqual = 48, GreaterEqual = 49, PlusPlus = 50, MinusMinus = 51, Exclamation = 52, Question = 53, LeftParen = 54, RightParen = 55, LeftBrace = 56, RightBrace = 57, LeftBracket = 58, RightBracket = 59, Comma = 60, Semicolon = 61, Dot = 62, Colon = 63, Arrow = 64, Pipe = 65, PipePipe = 66, Hash = 67, Root = 68, Item = 69, Module = 70, Export = 71, Attribute = 72, Function = 73, FunctionClause = 74, Pattern = 75, RecordPattern = 76, Statement = 77, Expr = 78, BinaryExpr = 79, CallExpr = 80, FunExpr = 81, CaseExpr = 82, CaseClause = 83, IfExpr = 84, IfClause = 85, TryExpr = 86, CatchClause = 87, ReceiveExpr = 88, ReceiveClause = 89, RecordExpr = 90, Error = 91, Eof = 92,
}
Expand description

Element types for the Erlang language.

Variants§

§

Whitespace = 0

Whitespace characters.

§

Newline = 1

Newline characters.

§

Comment = 2

Comments.

§

Identifier = 3

Identifiers.

§

Atom = 4

Atoms.

§

Variable = 5

Variables.

§

Number = 6

Numbers.

§

String = 7

Strings.

§

Character = 8

Characters.

§

After = 9

after keyword.

§

And = 10

and keyword.

§

Andalso = 11

andalso keyword.

§

Band = 12

band keyword.

§

Begin = 13

begin keyword.

§

Bnot = 14

bnot keyword.

§

Bor = 15

bor keyword.

§

Bsl = 16

bsl keyword.

§

Bsr = 17

bsr keyword.

§

Bxor = 18

bxor keyword.

§

Case = 19

case keyword.

§

Catch = 20

catch keyword.

§

Cond = 21

cond keyword.

§

Div = 22

div keyword.

§

End = 23

end keyword.

§

Fun = 24

fun keyword.

§

If = 25

if keyword.

§

Let = 26

let keyword.

§

Not = 27

not keyword.

§

Of = 28

of keyword.

§

Or = 29

or keyword.

§

Orelse = 30

orelse keyword.

§

Query = 31

query keyword.

§

Receive = 32

receive keyword.

§

Rem = 33

rem keyword.

§

Try = 34

try keyword.

§

When = 35

when keyword.

§

Xor = 36

xor keyword.

§

Plus = 37

Plus operator (+).

§

Minus = 38

Minus operator (-).

§

Star = 39

Star operator (*).

§

Slash = 40

Slash operator (/).

§

Equal = 41

Equal operator (=).

§

EqualEqual = 42

EqualEqual operator (==).

§

SlashEqual = 43

SlashEqual operator (/=).

§

EqualColonEqual = 44

EqualColonEqual operator (=:=).

§

EqualSlashEqual = 45

EqualSlashEqual operator (=/=).

§

Less = 46

Less operator (<).

§

Greater = 47

Greater operator (>).

§

LessEqual = 48

LessEqual operator (=<).

§

GreaterEqual = 49

GreaterEqual operator (>=).

§

PlusPlus = 50

PlusPlus operator (++).

§

MinusMinus = 51

MinusMinus operator (--).

§

Exclamation = 52

Exclamation operator (!).

§

Question = 53

Question operator (?).

§

LeftParen = 54

Left parenthesis (().

§

RightParen = 55

Right parenthesis ()).

§

LeftBrace = 56

Left brace ({).

§

RightBrace = 57

Right brace (}).

§

LeftBracket = 58

Left bracket ([).

§

RightBracket = 59

Right bracket (]).

§

Comma = 60

Comma (,).

§

Semicolon = 61

Semicolon (;).

§

Dot = 62

Dot (.).

§

Colon = 63

Colon (:).

§

Arrow = 64

Arrow (->).

§

Pipe = 65

Pipe (|).

§

PipePipe = 66

PipePipe (||).

§

Hash = 67

Hash (#).

§

Root = 68

Root node of the Erlang AST.

§

Item = 69

An item in the module.

§

Module = 70

Module declaration.

§

Export = 71

Export attribute.

§

Attribute = 72

Generic attribute.

§

Function = 73

Function declaration.

§

FunctionClause = 74

A clause of a function.

§

Pattern = 75

A pattern matching expression.

§

RecordPattern = 76

A record pattern.

§

Statement = 77

A statement.

§

Expr = 78

An expression.

§

BinaryExpr = 79

A binary expression.

§

CallExpr = 80

A function call.

§

FunExpr = 81

A fun expression.

§

CaseExpr = 82

A case expression.

§

CaseClause = 83

A clause in a case expression.

§

IfExpr = 84

An if expression.

§

IfClause = 85

A clause in an if expression.

§

TryExpr = 86

A try expression.

§

CatchClause = 87

A catch clause.

§

ReceiveExpr = 88

A receive expression.

§

ReceiveClause = 89

A clause in a receive expression.

§

RecordExpr = 90

A record expression.

§

Error = 91

Error node.

§

Eof = 92

End of file.

Implementations§

Source§

impl ErlangElementType

Source

pub fn is_keyword(&self) -> bool

Returns true if the element type is a keyword.

Source

pub fn is_operator(&self) -> bool

Returns true if the element type is an operator.

Source

pub fn is_punctuation(&self) -> bool

Returns true if the element type is a punctuation.

Trait Implementations§

Source§

impl Clone for ErlangElementType

Source§

fn clone(&self) -> ErlangElementType

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 ErlangElementType

Source§

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

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

impl<'de> Deserialize<'de> for ErlangElementType

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 ErlangElementType

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<ErlangTokenType> for ErlangElementType

Source§

fn from(token: ErlangTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for ErlangElementType

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 ErlangElementType

Source§

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

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 ErlangElementType

Source§

impl Eq for ErlangElementType

Source§

impl StructuralPartialEq for ErlangElementType

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