#[repr(u8)]pub enum JavaScriptTokenType {
Show 122 variants
Abstract = 0,
As = 1,
Async = 2,
Await = 3,
Break = 4,
Case = 5,
Catch = 6,
Class = 7,
Const = 8,
Continue = 9,
Debugger = 10,
Default = 11,
Delete = 12,
Do = 13,
Else = 14,
Enum = 15,
Export = 16,
Extends = 17,
False = 18,
Finally = 19,
For = 20,
Function = 21,
If = 22,
Implements = 23,
Import = 24,
In = 25,
Instanceof = 26,
Interface = 27,
Let = 28,
New = 29,
Null = 30,
Package = 31,
Private = 32,
Protected = 33,
Public = 34,
Return = 35,
Static = 36,
Super = 37,
Switch = 38,
This = 39,
Throw = 40,
True = 41,
Try = 42,
Typeof = 43,
Undefined = 44,
Var = 45,
Void = 46,
While = 47,
With = 48,
Yield = 49,
Plus = 50,
Minus = 51,
Star = 52,
Slash = 53,
Percent = 54,
StarStar = 55,
PlusPlus = 56,
MinusMinus = 57,
LeftShift = 58,
RightShift = 59,
UnsignedRightShift = 60,
Less = 61,
Greater = 62,
LessEqual = 63,
GreaterEqual = 64,
EqualEqual = 65,
NotEqual = 66,
EqualEqualEqual = 67,
NotEqualEqual = 68,
Ampersand = 69,
Pipe = 70,
Caret = 71,
Exclamation = 72,
Tilde = 73,
AmpersandAmpersand = 74,
PipePipe = 75,
Question = 76,
QuestionQuestion = 77,
QuestionDot = 78,
Equal = 79,
PlusEqual = 80,
MinusEqual = 81,
StarEqual = 82,
SlashEqual = 83,
PercentEqual = 84,
StarStarEqual = 85,
LeftShiftEqual = 86,
RightShiftEqual = 87,
UnsignedRightShiftEqual = 88,
AmpersandEqual = 89,
PipeEqual = 90,
CaretEqual = 91,
AmpersandAmpersandEqual = 92,
PipePipeEqual = 93,
QuestionQuestionEqual = 94,
LeftParen = 95,
RightParen = 96,
LeftBrace = 97,
RightBrace = 98,
LeftBracket = 99,
RightBracket = 100,
Semicolon = 101,
Comma = 102,
Dot = 103,
DotDotDot = 104,
Colon = 105,
Arrow = 106,
StringLiteral = 107,
NumericLiteral = 108,
BigIntLiteral = 109,
RegexLiteral = 110,
TemplateString = 111,
TemplateHead = 112,
TemplateMiddle = 113,
TemplateTail = 114,
IdentifierName = 115,
LineComment = 116,
BlockComment = 117,
Whitespace = 118,
Newline = 119,
Eof = 120,
Error = 121,
}Expand description
JavaScript token types.
Variants§
Abstract = 0
abstract
As = 1
as
Async = 2
async
Await = 3
await
Break = 4
break
Case = 5
case
Catch = 6
catch
Class = 7
class
Const = 8
const
Continue = 9
continue
Debugger = 10
debugger
Default = 11
default
Delete = 12
delete
Do = 13
do
Else = 14
else
Enum = 15
enum
Export = 16
export
Extends = 17
extends
False = 18
false
Finally = 19
finally
For = 20
for
Function = 21
function
If = 22
if
Implements = 23
implements
Import = 24
import
In = 25
in
Instanceof = 26
instanceof
Interface = 27
interface
Let = 28
let
New = 29
new
Null = 30
null
Package = 31
package
Private = 32
private
Protected = 33
protected
Public = 34
public
Return = 35
return
Static = 36
static
Super = 37
super
Switch = 38
switch
This = 39
this
Throw = 40
throw
True = 41
true
Try = 42
try
Typeof = 43
typeof
Undefined = 44
undefined
Var = 45
var
Void = 46
void
While = 47
while
With = 48
with
Yield = 49
yield
Plus = 50
+
Minus = 51
-
Star = 52
*
Slash = 53
/
Percent = 54
%
StarStar = 55
**
PlusPlus = 56
++
MinusMinus = 57
--
LeftShift = 58
<<
RightShift = 59
>>
UnsignedRightShift = 60
>>>
Less = 61
<
Greater = 62
>
LessEqual = 63
<=
GreaterEqual = 64
>=
EqualEqual = 65
==
NotEqual = 66
!=
EqualEqualEqual = 67
===
NotEqualEqual = 68
!==
Ampersand = 69
&
Pipe = 70
|
Caret = 71
^
Exclamation = 72
!
Tilde = 73
~
AmpersandAmpersand = 74
&&
PipePipe = 75
||
Question = 76
?
QuestionQuestion = 77
??
QuestionDot = 78
?.
Equal = 79
=
PlusEqual = 80
+=
MinusEqual = 81
-=
StarEqual = 82
*=
SlashEqual = 83
/=
PercentEqual = 84
%=
StarStarEqual = 85
**=
LeftShiftEqual = 86
<<=
RightShiftEqual = 87
>>=
UnsignedRightShiftEqual = 88
>>>=
AmpersandEqual = 89
&=
PipeEqual = 90
|=
CaretEqual = 91
^=
AmpersandAmpersandEqual = 92
&&=
PipePipeEqual = 93
||=
QuestionQuestionEqual = 94
??=
LeftParen = 95
(
RightParen = 96
)
LeftBrace = 97
{
RightBrace = 98
}
LeftBracket = 99
[
RightBracket = 100
]
Semicolon = 101
;
Comma = 102
,
Dot = 103
.
DotDotDot = 104
...
Colon = 105
:
Arrow = 106
=>
StringLiteral = 107
String literal
NumericLiteral = 108
Numeric literal
BigIntLiteral = 109
BigInt literal
RegexLiteral = 110
Regex literal
TemplateString = 111
Template string
TemplateHead = 112
Template head
TemplateMiddle = 113
Template middle
TemplateTail = 114
Template tail
IdentifierName = 115
Identifier
LineComment = 116
Line comment
BlockComment = 117
Block comment
Whitespace = 118
Whitespace
Newline = 119
Newline
Eof = 120
End of stream
Error = 121
Error token
Implementations§
Source§impl JavaScriptTokenType
impl JavaScriptTokenType
Sourcepub fn is_keyword(&self) -> bool
pub fn is_keyword(&self) -> bool
Returns true if the token type is a keyword.
Sourcepub fn from_keyword(s: &str) -> Option<Self>
pub fn from_keyword(s: &str) -> Option<Self>
Returns the token type for the given keyword string.
Trait Implementations§
Source§impl Clone for JavaScriptTokenType
impl Clone for JavaScriptTokenType
Source§fn clone(&self) -> JavaScriptTokenType
fn clone(&self) -> JavaScriptTokenType
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 JavaScriptTokenType
impl Debug for JavaScriptTokenType
Source§impl<'de> Deserialize<'de> for JavaScriptTokenType
impl<'de> Deserialize<'de> for JavaScriptTokenType
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 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 JavaScriptTokenType
impl Hash for JavaScriptTokenType
Source§impl PartialEq for JavaScriptTokenType
impl PartialEq for JavaScriptTokenType
Source§impl Serialize for JavaScriptTokenType
impl Serialize for JavaScriptTokenType
Source§impl TokenType for JavaScriptTokenType
impl TokenType for JavaScriptTokenType
Source§const END_OF_STREAM: Self = Self::Error
const END_OF_STREAM: Self = Self::Error
A constant representing the end of the input stream.
Source§type Role = UniversalTokenRole
type Role = UniversalTokenRole
The associated role type for this token kind.
Source§fn is_ignored(&self) -> bool
fn is_ignored(&self) -> bool
Returns true if this token represents trivia (whitespace, comments, etc.).
Source§fn is_role(&self, role: Self::Role) -> bool
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
fn is_universal(&self, role: UniversalTokenRole) -> bool
Returns true if this token matches the specified universal role.
Source§fn is_comment(&self) -> bool
fn is_comment(&self) -> bool
Returns true if this token represents a comment.
Source§fn is_whitespace(&self) -> bool
fn is_whitespace(&self) -> bool
Returns true if this token represents whitespace.
Source§fn is_end_of_stream(&self) -> bool
fn is_end_of_stream(&self) -> bool
Returns true if this token represents the end of the input stream.
impl Copy for JavaScriptTokenType
impl Eq for JavaScriptTokenType
impl StructuralPartialEq for JavaScriptTokenType
Auto Trait Implementations§
impl Freeze for JavaScriptTokenType
impl RefUnwindSafe for JavaScriptTokenType
impl Send for JavaScriptTokenType
impl Sync for JavaScriptTokenType
impl Unpin for JavaScriptTokenType
impl UnsafeUnpin for JavaScriptTokenType
impl UnwindSafe for JavaScriptTokenType
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