Struct LexerState
pub struct LexerState {
pub line_ctr: LineCounter,
pub last_token: Option<LastToken>,
/* private fields */
}Expand description
Mutable lex-pass state (Lark’s LexerState minus the text, which callers
borrow): the tracker + last_token, which Lark updates only on a returned
token and error reporting later consumes.
Fields§
§line_ctr: LineCounter§last_token: Option<LastToken>Implementations§
§impl LexerState
impl LexerState
pub fn new() -> Self
pub fn for_text(text: &str) -> Self
pub fn for_text(text: &str) -> Self
A fresh state bound to the text this pass will lex — the only difference
from Self::new is that its counter knows whether text is all-ASCII
(see LineCounter::for_text). Every slice fed to it must come from
text.
Trait Implementations§
§impl Clone for LexerState
impl Clone for LexerState
§fn clone(&self) -> LexerState
fn clone(&self) -> LexerState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for LexerState
impl Debug for LexerState
Auto Trait Implementations§
impl Freeze for LexerState
impl RefUnwindSafe for LexerState
impl Send for LexerState
impl Sync for LexerState
impl Unpin for LexerState
impl UnsafeUnpin for LexerState
impl UnwindSafe for LexerState
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