#[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
ParenExpr
Tpl
FnExpr
ClassExpr
JSXOpeningTag
JSXClosingTag
JSXExpr
Implementations§
source§impl TokenContext
impl TokenContext
Trait Implementations§
source§impl Clone for TokenContext
impl Clone for TokenContext
source§fn clone(&self) -> TokenContext
fn clone(&self) -> TokenContext
Returns a copy 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 TokenContext
impl Debug for TokenContext
source§impl PartialEq for TokenContext
impl PartialEq for TokenContext
impl Copy for TokenContext
impl Eq for TokenContext
impl StructuralPartialEq for TokenContext
Auto Trait Implementations§
impl Freeze for TokenContext
impl RefUnwindSafe for TokenContext
impl Send for TokenContext
impl Sync for TokenContext
impl Unpin for TokenContext
impl UnwindSafe for TokenContext
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more