[−][src]Enum boa::syntax::lexer::token::TokenKind
Represents the type of Token and the data it has inside.
Variants
BooleanLiteral(bool)A boolean literal, which is either true or false.
The end of the file.
An identifier.
Keyword(Keyword)A keyword.
see: Keyword
A null literal.
NumericLiteral(Numeric)A numeric literal.
Punctuator(Punctuator)A piece of punctuation
see: Punctuator
A string literal.
A part of a template literal without substitution.
Fields of TemplateNoSubstitution
The part of a template literal between substitutions
Fields of TemplateMiddle
A regular expression, consisting of body and flags.
Indicates the end of a line (\n).
Indicates a comment, the content isn't stored.
Implementations
impl TokenKind[src]
pub fn boolean_literal(lit: bool) -> Self[src]
Creates a BooleanLiteral token kind.
pub fn eof() -> Self[src]
Creates an EOF token kind.
pub fn identifier<I>(ident: I) -> Self where
I: Into<Box<str>>, [src]
I: Into<Box<str>>,
Creates an Identifier token type.
pub fn keyword(keyword: Keyword) -> Self[src]
Creates a Keyword token kind.
pub fn numeric_literal<L>(lit: L) -> Self where
L: Into<Numeric>, [src]
L: Into<Numeric>,
Creates a NumericLiteral token kind.
pub fn punctuator(punc: Punctuator) -> Self[src]
Creates a Punctuator token type.
pub fn string_literal<S>(lit: S) -> Self where
S: Into<Box<str>>, [src]
S: Into<Box<str>>,
Creates a StringLiteral token type.
pub fn template_middle<R, C>(raw: R, cooked: C) -> Self where
R: Into<Box<str>>,
C: Into<Box<str>>, [src]
R: Into<Box<str>>,
C: Into<Box<str>>,
pub fn template_no_substitution<R, C>(raw: R, cooked: C) -> Self where
R: Into<Box<str>>,
C: Into<Box<str>>, [src]
R: Into<Box<str>>,
C: Into<Box<str>>,
pub fn regular_expression_literal<B, R>(body: B, flags: R) -> Self where
B: Into<Box<str>>,
R: Into<RegExpFlags>, [src]
B: Into<Box<str>>,
R: Into<RegExpFlags>,
Creates a RegularExpressionLiteral token kind.
pub fn line_terminator() -> Self[src]
Creates a LineTerminator token kind.
pub fn comment() -> Self[src]
Creates a 'Comment' token kind.
Trait Implementations
impl Clone for TokenKind[src]
impl Debug for TokenKind[src]
impl Display for TokenKind[src]
impl From<Keyword> for TokenKind[src]
impl From<Numeric> for TokenKind[src]
impl From<Punctuator> for TokenKind[src]
pub fn from(punc: Punctuator) -> Self[src]
impl From<bool> for TokenKind[src]
impl PartialEq<TokenKind> for TokenKind[src]
impl StructuralPartialEq for TokenKind[src]
Auto Trait Implementations
impl RefUnwindSafe for TokenKind[src]
impl Send for TokenKind[src]
impl Sync for TokenKind[src]
impl Unpin for TokenKind[src]
impl UnwindSafe for TokenKind[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,