[−][src]Struct syntex_syntax2::parse::lexer::StringReader
Fields
sess: &'a ParseSess
next_pos: BytePos
The absolute offset within the codemap of the next character to read
pos: BytePos
The absolute offset within the codemap of the current character
col: CharPos
The column of the next character to read
ch: Option<char>
The current character (which has been read from self.pos)
filemap: Rc<FileMap>
terminator: Option<BytePos>
If Some, stop reading the source at this position (inclusive).
save_new_lines_and_multibyte: bool
Whether to record new-lines and multibyte chars in filemap. This is only necessary the first time a filemap is lexed. If part of a filemap is being re-lexed, this should be set to false.
peek_tok: Token
peek_span: Span
fatal_errs: Vec<DiagnosticBuilder<'a>>
Methods
impl<'a> StringReader<'a>
[src]
pub fn parse_all_token_trees(&mut self) -> PResult<'a, TokenStream>
[src]
impl<'a> StringReader<'a>
[src]
pub fn real_token(&mut self) -> TokenAndSpan
[src]
pub fn try_next_token(&mut self) -> Result<TokenAndSpan, ()>
[src]
Return the next token. EFFECT: advances the string_reader.
pub fn emit_fatal_errors(&mut self)
[src]
pub fn peek(&self) -> TokenAndSpan
[src]
impl<'a> StringReader<'a>
[src]
pub fn new_raw(sess: &'a ParseSess, filemap: Rc<FileMap>) -> Self
[src]
For comments.rs, which hackily pokes into next_pos and ch
pub fn new(sess: &'a ParseSess, filemap: Rc<FileMap>) -> Self
[src]
pub fn retokenize(sess: &'a ParseSess, span: Span) -> Self
[src]
pub fn ch_is(&self, c: char) -> bool
[src]
pub fn fatal_span(&self, sp: Span, m: &str) -> FatalError
[src]
Report a fatal lexical error with a given span.
pub fn err_span(&self, sp: Span, m: &str)
[src]
Report a lexical error with a given span.
pub fn with_str_from<T, F>(&self, start: BytePos, f: F) -> T where
F: FnOnce(&str) -> T,
[src]
F: FnOnce(&str) -> T,
Calls f
with a string slice of the source text spanning from start
up to but excluding self.pos
, meaning the slice does not include
the character self.ch
.
pub fn name_from(&self, start: BytePos) -> Name
[src]
Create a Name from a given offset to the current offset, each adjusted 1 towards each other (assumes that on either side there is a single-byte delimiter).
pub fn name_from_to(&self, start: BytePos, end: BytePos) -> Name
[src]
As name_from, with an explicit endpoint.
pub fn bump(&mut self)
[src]
Advance the StringReader by one character. If a newline is discovered, add it to the FileMap's list of line start offsets.
pub fn nextch(&self) -> Option<char>
[src]
pub fn nextch_is(&self, c: char) -> bool
[src]
pub fn nextnextch(&self) -> Option<char>
[src]
pub fn nextnextch_is(&self, c: char) -> bool
[src]
Auto Trait Implementations
impl<'a> !Send for StringReader<'a>
impl<'a> Unpin for StringReader<'a>
impl<'a> !Sync for StringReader<'a>
impl<'a> !UnwindSafe for StringReader<'a>
impl<'a> !RefUnwindSafe for StringReader<'a>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,