pub enum GrammarContext {
AllowRegExp,
AllowDiv,
AllowJSXIdentifier,
Type,
}Expand description
The grammar context affecting how some tokens are lexed (e.g. / as a
division operator vs. a regular-expression literal). Port of
JSLexer::GrammarContext.
Variants§
AllowRegExp
A RegExp can follow, so / starts a regular-expression literal.
AllowDiv
/ can follow, so it is scanned as the division operator.
AllowJSXIdentifier
/ can follow, - is part of identifiers, and > is scanned as its
own token.
Type
A type annotation: / can follow, >> scans as two separate >
tokens, and legacy octal literals are rejected as in strict mode.
Trait Implementations§
Source§impl Clone for GrammarContext
impl Clone for GrammarContext
Source§fn clone(&self) -> GrammarContext
fn clone(&self) -> GrammarContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GrammarContext
Source§impl Debug for GrammarContext
impl Debug for GrammarContext
impl Eq for GrammarContext
Source§impl PartialEq for GrammarContext
impl PartialEq for GrammarContext
impl StructuralPartialEq for GrammarContext
Auto Trait Implementations§
impl Freeze for GrammarContext
impl RefUnwindSafe for GrammarContext
impl Send for GrammarContext
impl Sync for GrammarContext
impl Unpin for GrammarContext
impl UnsafeUnpin for GrammarContext
impl UnwindSafe for GrammarContext
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