[][src]Enum boa::syntax::ast::token::TokenKind

pub enum TokenKind {
    BooleanLiteral(bool),
    EOF,
    Identifier(Box<str>),
    Keyword(Keyword),
    NullLiteral,
    NumericLiteral(NumericLiteral),
    Punctuator(Punctuator),
    StringLiteral(Box<str>),
    TemplateLiteral(Box<str>),
    RegularExpressionLiteral(Box<str>, RegExpFlags),
    LineTerminator,
}

Represents the type of Token and the data it has inside.

Variants

BooleanLiteral(bool)

A boolean literal, which is either true or false.

EOF

The end of the file.

Identifier(Box<str>)

An identifier.

Keyword(Keyword)

A keyword.

see: Keyword

NullLiteral

A null literal.

NumericLiteral(NumericLiteral)

A numeric literal.

Punctuator(Punctuator)

A piece of punctuation

see: Punctuator

StringLiteral(Box<str>)

A string literal.

TemplateLiteral(Box<str>)
RegularExpressionLiteral(Box<str>, RegExpFlags)

A regular expression, consisting of body and flags.

LineTerminator

Indicates the end of a line (\n).

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]

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<NumericLiteral>, 
[src]

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]

Creates a StringLiteral token type.

pub fn template_literal<S>(lit: S) -> Self where
    S: Into<Box<str>>, 
[src]

Creates a TemplateLiteral token type.

pub fn regular_expression_literal<B>(body: B, flags: RegExpFlags) -> Self where
    B: Into<Box<str>>, 
[src]

Creates a RegularExpressionLiteral token kind.

pub fn line_terminator() -> Self[src]

Creates a LineTerminator 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<Punctuator> for TokenKind[src]

impl From<bool> for TokenKind[src]

impl PartialEq<TokenKind> for TokenKind[src]

impl StructuralPartialEq for TokenKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,