[−][src]Enum boa::syntax::ast::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(NumericLiteral)
A numeric literal.
Punctuator(Punctuator)
A piece of punctuation
see: Punctuator
A string literal.
RegularExpressionLiteral(Box<str>, RegExpFlags)
A regular expression, consisting of body and flags.
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]
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<NumericLiteral>,
[src]
L: Into<NumericLiteral>,
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_literal<S>(lit: S) -> Self where
S: Into<Box<str>>,
[src]
S: Into<Box<str>>,
Creates a TemplateLiteral
token type.
pub fn regular_expression_literal<B>(body: B, flags: RegExpFlags) -> Self where
B: Into<Box<str>>,
[src]
B: Into<Box<str>>,
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]
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
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnwindSafe for TokenKind
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,
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.
fn to_owned(&self) -> T
[src]
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.
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.
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>,