[][src]Struct rslint_parser::TokenSource

pub struct TokenSource<'t> {
    pub raw_tokens: &'t [Token],
    // some fields omitted
}

The source of tokens for the parser

Fields

raw_tokens: &'t [Token]

A list of the tokens including whitespace.

Implementations

impl<'t> TokenSource<'t>[src]

pub fn new(source: &'t str, raw_tokens: &'t [Token]) -> TokenSource<'t>[src]

Generate input from tokens(except comments and whitespace).

Panics

This method will panic in case the source and raw tokens do not match as it relies on the source code for checking if trivia contains linebreaks

pub fn rewind(&mut self, pos: usize)[src]

Rewind the current position to a former position.

pub fn last(&self) -> Option<Token>[src]

pub fn current(&self) -> Token[src]

pub fn source(&self) -> &str[src]

pub fn lookahead_nth(&self, n: usize) -> Token[src]

pub fn bump(&mut self)[src]

pub fn is_keyword(&self, kw: &str) -> bool[src]

pub fn had_linebreak_before_nth(&self, n: usize) -> bool[src]

pub fn cur_pos(&self) -> usize[src]

pub fn cur_token_idx(&self) -> usize[src]

pub fn size_hint(&self) -> usize[src]

Auto Trait Implementations

impl<'t> RefUnwindSafe for TokenSource<'t>

impl<'t> Send for TokenSource<'t>

impl<'t> Sync for TokenSource<'t>

impl<'t> Unpin for TokenSource<'t>

impl<'t> UnwindSafe for TokenSource<'t>

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> Erasable for T

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.