#[repr(u8)]pub enum JavaScriptElementType {
Show 69 variants
Root = 0,
Statement = 1,
Expression = 2,
Block = 3,
Error = 4,
FunctionDeclaration = 5,
VariableDeclaration = 6,
IfStatement = 7,
WhileStatement = 8,
ForStatement = 9,
ReturnStatement = 10,
BlockStatement = 11,
Identifier = 12,
Literal = 13,
CallExpression = 14,
MemberExpression = 15,
AssignmentExpression = 16,
LogicalExpression = 17,
BinaryExpression = 18,
Abstract = 19,
As = 20,
Async = 21,
Await = 22,
Break = 23,
Case = 24,
Catch = 25,
Class = 26,
Const = 27,
Continue = 28,
Debugger = 29,
Default = 30,
Delete = 31,
Do = 32,
Else = 33,
Enum = 34,
Export = 35,
Extends = 36,
False = 37,
Finally = 38,
For = 39,
Function = 40,
If = 41,
Implements = 42,
Import = 43,
In = 44,
Instanceof = 45,
Interface = 46,
Let = 47,
New = 48,
Null = 49,
Package = 50,
Private = 51,
Protected = 52,
Public = 53,
Return = 54,
Static = 55,
Super = 56,
Switch = 57,
This = 58,
Throw = 59,
True = 60,
Try = 61,
Typeof = 62,
Undefined = 63,
Var = 64,
Void = 65,
While = 66,
With = 67,
Yield = 68,
}Expand description
JavaScript element types.
Variants§
Root = 0
Root node
Statement = 1
Statement
Expression = 2
Expression
Block = 3
Block
Error = 4
Error node
FunctionDeclaration = 5
Function declaration
VariableDeclaration = 6
Variable declaration
IfStatement = 7
If statement
WhileStatement = 8
While statement
ForStatement = 9
For statement
ReturnStatement = 10
Return statement
BlockStatement = 11
Block statement
Identifier = 12
Identifier
Literal = 13
Literal
CallExpression = 14
Call expression
MemberExpression = 15
Member expression
AssignmentExpression = 16
Assignment expression
LogicalExpression = 17
Logical expression
BinaryExpression = 18
Binary expression
Abstract = 19
abstract
As = 20
as
Async = 21
async
Await = 22
await
Break = 23
break
Case = 24
case
Catch = 25
catch
Class = 26
class
Const = 27
const
Continue = 28
continue
Debugger = 29
debugger
Default = 30
default
Delete = 31
delete
Do = 32
do
Else = 33
else
Enum = 34
enum
Export = 35
export
Extends = 36
extends
False = 37
false
Finally = 38
finally
For = 39
for
Function = 40
function
If = 41
if
Implements = 42
implements
Import = 43
import
In = 44
in
Instanceof = 45
instanceof
Interface = 46
interface
Let = 47
let
New = 48
new
Null = 49
null
Package = 50
package
Private = 51
private
Protected = 52
protected
Public = 53
public
Return = 54
return
Static = 55
static
Super = 56
super
Switch = 57
switch
This = 58
this
Throw = 59
throw
True = 60
true
Try = 61
try
Typeof = 62
typeof
Undefined = 63
undefined
Var = 64
var
Void = 65
void
While = 66
while
With = 67
with
Yield = 68
yield
Implementations§
Source§impl JavaScriptElementType
impl JavaScriptElementType
Sourcepub fn is_keyword(&self) -> bool
pub fn is_keyword(&self) -> bool
Returns true if the element type is a keyword.
Sourcepub fn from_keyword(s: &str) -> Option<Self>
pub fn from_keyword(s: &str) -> Option<Self>
Returns the element type for the given keyword string.
Trait Implementations§
Source§impl Clone for JavaScriptElementType
impl Clone for JavaScriptElementType
Source§fn clone(&self) -> JavaScriptElementType
fn clone(&self) -> JavaScriptElementType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JavaScriptElementType
impl Debug for JavaScriptElementType
Source§impl<'de> Deserialize<'de> for JavaScriptElementType
impl<'de> Deserialize<'de> for JavaScriptElementType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 JavaScriptElementType
impl ElementType for JavaScriptElementType
Source§type Role = UniversalElementRole
type Role = UniversalElementRole
The associated role type for this element kind.
Source§fn is_role(&self, role: Self::Role) -> bool
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
fn is_universal(&self, role: UniversalElementRole) -> bool
Returns true if this element matches the specified universal role.
Source§impl From<JavaScriptTokenType> for JavaScriptElementType
impl From<JavaScriptTokenType> for JavaScriptElementType
Source§fn from(token: JavaScriptTokenType) -> Self
fn from(token: JavaScriptTokenType) -> Self
Converts to this type from the input type.
Source§impl Hash for JavaScriptElementType
impl Hash for JavaScriptElementType
Source§impl PartialEq for JavaScriptElementType
impl PartialEq for JavaScriptElementType
Source§impl Serialize for JavaScriptElementType
impl Serialize for JavaScriptElementType
impl Copy for JavaScriptElementType
impl Eq for JavaScriptElementType
impl StructuralPartialEq for JavaScriptElementType
Auto Trait Implementations§
impl Freeze for JavaScriptElementType
impl RefUnwindSafe for JavaScriptElementType
impl Send for JavaScriptElementType
impl Sync for JavaScriptElementType
impl Unpin for JavaScriptElementType
impl UnsafeUnpin for JavaScriptElementType
impl UnwindSafe for JavaScriptElementType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more