[][src]Trait lrpar::NonStreamingLexer

pub trait NonStreamingLexer<'input, StorageT: Hash + PrimInt + Unsigned>: Lexer<StorageT> {
    pub fn span_str(&self, span: Span) -> &'input str;
pub fn span_lines_str(&self, span: Span) -> &'input str;
pub fn line_col(&self, span: Span) -> ((usize, usize), (usize, usize)); }

A NonStreamingLexer is one that takes input in one go, and is then able to hand out substrings to that input and calculate line and column numbers from a Span.

Required methods

pub fn span_str(&self, span: Span) -> &'input str[src]

Return the user input associated with a Span.

Panics

If the span exceeds the known input.

pub fn span_lines_str(&self, span: Span) -> &'input str[src]

Return the lines containing the input at span (including all the text on the lines that span starts and ends on).

Panics

If the span exceeds the known input.

pub fn line_col(&self, span: Span) -> ((usize, usize), (usize, usize))[src]

Return ((start line, start column), (end line, end column)) for span. Note that column characters (not bytes) are returned.

Panics

If the span exceeds the known input.

Loading content...

Implementors

Loading content...