Trait lib_ruby_parser::LocExt
source · 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§
sourcefn begin_line_col(&self, input: &DecodedInput) -> Option<(usize, usize)>
fn begin_line_col(&self, input: &DecodedInput) -> Option<(usize, usize)>
Returns line and column of the begin
of the Loc
on a given Input
sourcefn expand_to_line(&self, input: &DecodedInput) -> Option<(usize, Loc)>
fn expand_to_line(&self, input: &DecodedInput) -> Option<(usize, Loc)>
Expands Loc
to the whole line and returns line number and new Loc
sourcefn source(&self, input: &DecodedInput) -> Option<String>
fn source(&self, input: &DecodedInput) -> Option<String>
Returns source code of the current Loc
on a given Input