Enum as3_parser::Token
source · pub enum Token {
Show 120 variants
Eof,
Identifier(String),
StringLiteral(String),
NumericLiteral(f64),
RegExpLiteral {
body: String,
flags: String,
},
ColonColon,
Attribute,
Descendants,
Ellipsis,
LeftParen,
RightParen,
LeftBracket,
RightBracket,
LeftBrace,
RightBrace,
Dot,
Semicolon,
Comma,
Lt,
Gt,
Le,
Ge,
Equals,
NotEquals,
StrictEquals,
StrictNotEquals,
Plus,
Minus,
Times,
Div,
Remainder,
Increment,
Decrement,
LeftShift,
RightShift,
UnsignedRightShift,
BitwiseAnd,
BitwiseXor,
BitwiseOr,
BitwiseNot,
LogicalAnd,
LogicalXor,
LogicalOr,
Question,
Exclamation,
Colon,
Assign,
AddAssign,
SubtractAssign,
MultiplyAssign,
DivideAssign,
RemainderAssign,
LeftShiftAssign,
RightShiftAssign,
UnsignedRightShiftAssign,
BitwiseAndAssign,
BitwiseXorAssign,
BitwiseOrAssign,
LogicalAndAssign,
LogicalXorAssign,
LogicalOrAssign,
FatArrow,
Power,
PowerAssign,
NullCoalescing,
NullCoalescingAssign,
OptionalChaining,
As,
Await,
Break,
Case,
Catch,
Class,
Const,
Continue,
Default,
Delete,
Do,
Else,
Export,
Extends,
False,
Finally,
For,
Function,
If,
Implements,
Import,
In,
Instanceof,
Interface,
Internal,
Is,
New,
Null,
Package,
Private,
Protected,
Public,
Return,
Super,
Switch,
This,
Throw,
True,
Try,
Typeof,
Use,
Var,
Void,
While,
With,
Yield,
XmlWhitespace,
XmlLtSlash,
XmlSlashGt,
XmlText(String),
XmlName(String),
XmlMarkup(String),
XmlAttributeValue(String),
}
Expand description
Represents a lexical token.
Variants§
Eof
Identifier(String)
StringLiteral(String)
NumericLiteral(f64)
RegExpLiteral
ColonColon
Attribute
The @
token.
Descendants
The ..
token.
Ellipsis
The ...
token.
LeftParen
RightParen
LeftBracket
RightBracket
LeftBrace
RightBrace
Dot
Semicolon
Comma
Lt
Gt
Le
<=
Ge
>=
Equals
NotEquals
StrictEquals
StrictNotEquals
Plus
Minus
Times
Div
Remainder
Increment
Decrement
LeftShift
RightShift
UnsignedRightShift
BitwiseAnd
BitwiseXor
BitwiseOr
BitwiseNot
LogicalAnd
LogicalXor
LogicalOr
Question
Exclamation
Colon
Assign
AddAssign
SubtractAssign
MultiplyAssign
DivideAssign
RemainderAssign
LeftShiftAssign
RightShiftAssign
UnsignedRightShiftAssign
BitwiseAndAssign
BitwiseXorAssign
BitwiseOrAssign
LogicalAndAssign
LogicalXorAssign
LogicalOrAssign
FatArrow
=>
Power
**
PowerAssign
**=
NullCoalescing
??
NullCoalescingAssign
??=
OptionalChaining
?.
As
Await
Break
Case
Catch
Class
Const
Continue
Default
Delete
Do
Else
Export
Extends
False
Finally
For
Function
If
Implements
Import
In
Instanceof
Interface
Internal
Is
New
Null
Package
Private
Protected
Public
Return
Super
Switch
This
Throw
True
Try
Typeof
Use
Var
Void
While
With
Yield
XmlWhitespace
XmlLtSlash
XmlSlashGt
XmlText(String)
XmlName(String)
XmlMarkup(String)
XmlAttributeValue(String)
Implementations§
source§impl Token
impl Token
sourcepub fn is_reserved_word(&self) -> bool
pub fn is_reserved_word(&self) -> bool
Indicates whether the token is a reserved word.
sourcepub fn reserved_word_name(&self) -> Option<String>
pub fn reserved_word_name(&self) -> Option<String>
Tests whether the token is a reserved word and returns its IdentifierName string.
sourcepub fn compound_assignment(&self) -> Option<Operator>
pub fn compound_assignment(&self) -> Option<Operator>
Converts a compound assignment, a logical assignment, or a nullish coalescing assignment to an operator.
sourcepub fn to_binary_operator(&self) -> Option<Operator>
pub fn to_binary_operator(&self) -> Option<Operator>
Converts this token into a binary operator, excluding
not instanceof
, not in
, and is not
.
Trait Implementations§
source§impl PartialEq for Token
impl PartialEq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.