Struct esparse::lex::Tok [] [src]

pub struct Tok<'f, 's> {
    pub tt: Tt<'s>,
    pub span: Span<'f>,
    pub ws_before: &'s str,
    pub nl_before: bool,
}

A token (an atomic parsing unit).

Tokens have a type represented by the Tt enumeration. They also have location information and track the whitespace and comments that appeared before them in the source code.

Fields

The token type.

The source region this token covers.

Any whitespace and comments that appeared directly before this token.

true if ws_before contains a line terminator.

Methods

impl<'f, 's> Tok<'f, 's>
[src]

Creates a new Token with no preceding whitespace.

Trait Implementations

impl<'f, 's> Debug for Tok<'f, 's>
[src]

Formats the value using the given formatter.

impl<'f, 's> Clone for Tok<'f, 's>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'f, 's> Copy for Tok<'f, 's>
[src]

impl<'f, 's> PartialEq for Tok<'f, 's>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'f, 's> Eq for Tok<'f, 's>
[src]

impl<'f, 's> Hash for Tok<'f, 's>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more