Trait syntax::parse::lexer::Reader
[−]
[src]
pub trait Reader {
fn is_eof(&self) -> bool;
fn try_next_token(&mut self) -> Result<TokenAndSpan, ()>;
fn fatal(&self, &str) -> FatalError;
fn err(&self, &str);
fn emit_fatal_errors(&mut self);
fn peek(&self) -> TokenAndSpan;
fn next_token(&mut self) -> TokenAndSpan where Self: Sized { ... }
fn unwrap_or_abort(&mut self, res: Result<TokenAndSpan, ()>) -> TokenAndSpan { ... }
fn try_real_token(&mut self) -> Result<TokenAndSpan, ()> { ... }
fn real_token(&mut self) -> TokenAndSpan { ... }
}
Unstable (
rustc_private
)Required Methods
fn is_eof(&self) -> bool
Unstable (
rustc_private
)fn try_next_token(&mut self) -> Result<TokenAndSpan, ()>
Unstable (
rustc_private
)fn fatal(&self, &str) -> FatalError
Unstable (
rustc_private
)Report a fatal error with the current span.
fn err(&self, &str)
Unstable (
rustc_private
)Report a non-fatal error with the current span.
fn emit_fatal_errors(&mut self)
Unstable (
rustc_private
)fn peek(&self) -> TokenAndSpan
Unstable (
rustc_private
)Provided Methods
fn next_token(&mut self) -> TokenAndSpan where Self: Sized
Unstable (
rustc_private
)fn unwrap_or_abort(&mut self, res: Result<TokenAndSpan, ()>) -> TokenAndSpan
Unstable (
rustc_private
)fn try_real_token(&mut self) -> Result<TokenAndSpan, ()>
Unstable (
rustc_private
)Get a token the parser cares about.
fn real_token(&mut self) -> TokenAndSpan
Unstable (
rustc_private
)Implementors
impl<'a> Reader for StringReader<'a>
impl<'a> Reader for TtReader<'a>