Struct rustlr::lexer_interface::charlexer
source · pub struct charlexer<'t> {
pub modify: fn(_: char) -> String,
/* private fields */
}Expand description
This struct is deprecated by charscanner. It is compatible with
Lexer and Lextoken, which are also deprecated. This struct requires
the legacy-parser installation feature.
Fields§
§modify: fn(_: char) -> Stringfunction to modify char returned by nextsym, can be changed.
Both charlexer::make and charlexer::new sets this function
initially to |x|{x.to_string()}. For example, some characters such
as ‘{’ and ‘}’ cannot be used as terminal symbols of a grammar and must
be translated into something like “LBRACE” and “RBRACE”
Implementations§
Trait Implementations§
source§impl<'t, AT: Default> Lexer<AT> for charlexer<'t>
impl<'t, AT: Default> Lexer<AT> for charlexer<'t>
source§fn current_line(&self) -> &str
fn current_line(&self) -> &str
returns slice of underlying data using std::str::Chars::as_str
Auto Trait Implementations§
impl<'t> RefUnwindSafe for charlexer<'t>
impl<'t> Send for charlexer<'t>
impl<'t> Sync for charlexer<'t>
impl<'t> Unpin for charlexer<'t>
impl<'t> UnwindSafe for charlexer<'t>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more