pub trait LocExt {
    // Required methods
    fn begin_line_col(&self, input: &DecodedInput) -> Option<(usize, usize)>;
    fn expand_to_line(&self, input: &DecodedInput) -> Option<(usize, Loc)>;
    fn source(&self, input: &DecodedInput) -> Option<String>;
}
Expand description

A set of parser-specific extensions for Loc

Required Methods§

source

fn begin_line_col(&self, input: &DecodedInput) -> Option<(usize, usize)>

Returns line and column of the begin of the Loc on a given Input

source

fn expand_to_line(&self, input: &DecodedInput) -> Option<(usize, Loc)>

Expands Loc to the whole line and returns line number and new Loc

source

fn source(&self, input: &DecodedInput) -> Option<String>

Returns source code of the current Loc on a given Input

Implementors§