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) -> String
function 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> Freeze for charlexer<'t>
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