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

pub struct StringReader<'a> {
    pub sess: &'a ParseSess,
    pub next_pos: BytePos,
    pub pos: BytePos,
    pub col: CharPos,
    pub ch: Option<char>,
    pub filemap: Lrc<FileMap>,
    pub terminator: Option<BytePos>,
    pub save_new_lines_and_multibyte: bool,
    pub peek_tok: Token,
    pub peek_span: Span,
    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 column of the next character to read

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

If Some, stop reading the source at this position (inclusive).

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]

[src]

[src]

Return the next token. EFFECT: advances the string_reader.

[src]

[src]

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

[src]

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

[src]

[src]

[src]

[src]

Report a fatal lexical error with a given span.

[src]

Report a lexical error with a given span.

[src]

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.

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

[src]

As name_from, with an explicit endpoint.

[src]

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

[src]

[src]

[src]

[src]

Trait Implementations

Auto Trait Implementations

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

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