Trait Locatable

Source
pub trait Locatable {
    // Required methods
    fn current_position(&self) -> Position;
    fn last_position(&self) -> Position;
    fn get_location_from(&self, start: Position) -> SourceLocation;
}
Expand description

This trait produces a compiler’s current position and selects a range.

Required Methods§

Source

fn current_position(&self) -> Position

Returns the scanner’s current position in the source.

Source

fn last_position(&self) -> Position

Source

fn get_location_from(&self, start: Position) -> SourceLocation

Returns the scanner’s source location from the start position.

Implementors§

Source§

impl<'a, C: ErrorHandler> Locatable for Tokens<'a, C>