[][src]Trait ra_ap_parser::TokenSource

pub trait TokenSource {
    pub fn current(&self) -> Token;
pub fn lookahead_nth(&self, n: usize) -> Token;
pub fn bump(&mut self);
pub fn is_keyword(&self, kw: &str) -> bool; }

TokenSource abstracts the source of the tokens parser operates on.

Hopefully this will allow us to treat text and token trees in the same way!

Required methods

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

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

Lookahead n token

pub fn bump(&mut self)[src]

bump cursor to next token

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

Is the current token a specified keyword?

Loading content...

Implementors

Loading content...