Trait logos::Extras

source ·
pub trait Extras: Sized + Default {
    fn on_consume(&mut self) { ... }
    fn on_whitespace(&mut self, _byte: u8) { ... }
}
Expand description

Helper trait that can be injected into the Lexer to handle things that aren’t necessarily tokens, such as comments or Automatic Semicolon Insertion in JavaScript.

Provided Methods

Method called by the Lexer when a new token is about to be produced.

Method called by the Lexer when a white space byte has been encountered.

Implementations on Foreign Types

Default Extras with no logic

Implementors