Struct syntax::parse::lexer::StringReader[][src]

pub struct StringReader<'a> {
    pub sess: &'a ParseSess,
    pub next_pos: BytePos,
    pub pos: BytePos,
    pub ch: Option<char>,
    pub filemap: Lrc<FileMap>,
    pub end_src_index: usize,
    pub save_new_lines_and_multibyte: bool,
    pub fatal_errs: Vec<DiagnosticBuilder<'a>>,
    pub override_span: Option<Span>,
    // some fields omitted
}

Fields

The absolute offset within the codemap of the next character to read

The absolute offset within the codemap of the current character

The current character (which has been read from self.pos)

Stop reading src at this index.

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.

Methods

impl<'a> StringReader<'a>
[src]

impl<'a> StringReader<'a>
[src]

Return the next token. EFFECT: advances the string_reader.

impl<'a> StringReader<'a>
[src]

For comments.rs, which hackily pokes into next_pos and ch

Report a fatal lexical error with a given span.

Report a lexical error with a given span.

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.

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).

As name_from, with an explicit endpoint.

Advance the StringReader by one character. If a newline is discovered, add it to the FileMap's list of line start offsets.

Auto Trait Implementations

impl<'a> !Send for StringReader<'a>

impl<'a> !Sync for StringReader<'a>