Enum swc_ecma_parser::lexer::TokenContext
source · [−]#[repr(u8)]
pub enum TokenContext {
BraceStmt,
BraceExpr,
TplQuasi,
ParenStmt {
is_for_loop: bool,
},
ParenExpr,
Tpl {
start: BytePos,
},
FnExpr,
ClassExpr,
JSXOpeningTag,
JSXClosingTag,
JSXExpr,
}
Expand description
The algorithm used to determine whether a regexp can appear at a given point in the program is loosely based on sweet.js’ approach. See https://github.com/mozilla/sweet.js/wiki/design
Variants
BraceStmt
BraceExpr
TplQuasi
ParenStmt
Fields
is_for_loop: bool
Is this for
loop?
ParenExpr
Tpl
Fields
start: BytePos
Start of a template literal.
FnExpr
ClassExpr
JSXOpeningTag
JSXClosingTag
JSXExpr
Implementations
sourceimpl TokenContext
impl TokenContext
Trait Implementations
sourceimpl Clone for TokenContext
impl Clone for TokenContext
sourcefn clone(&self) -> TokenContext
fn clone(&self) -> TokenContext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for TokenContext
impl Debug for TokenContext
sourceimpl PartialEq<TokenContext> for TokenContext
impl PartialEq<TokenContext> for TokenContext
sourcefn eq(&self, other: &TokenContext) -> bool
fn eq(&self, other: &TokenContext) -> bool
impl Copy for TokenContext
impl Eq for TokenContext
impl StructuralEq for TokenContext
impl StructuralPartialEq for TokenContext
Auto Trait Implementations
impl RefUnwindSafe for TokenContext
impl Send for TokenContext
impl Sync for TokenContext
impl Unpin for TokenContext
impl UnwindSafe for TokenContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more