pub struct Lexer {
pub source: Vec<char>,
pub pos: usize,
pub line: u32,
pub column: u32,
pub last_string_had_escape: bool,
/* private fields */
}Fields§
§source: Vec<char>§pos: usize§line: u32§column: u32§last_string_had_escape: boolImplementations§
Source§impl Lexer
impl Lexer
pub fn new(source: &str) -> Self
pub fn next_token(&mut self) -> Option<Token>
pub fn set_pos(&mut self, pos: usize)
pub fn pos(&self) -> usize
pub fn column(&self) -> u32
pub fn set_column(&mut self, col: u32)
pub fn last_token_kind(&self) -> LastTokenKind
pub fn set_last_token_kind(&mut self, kind: LastTokenKind)
pub fn line(&self) -> u32
pub fn set_line(&mut self, line: u32)
pub fn get_current_line(&self) -> String
pub fn peek(&mut self) -> Option<Token>
pub fn get_context(&self, chars: usize) -> String
pub fn read_template_chars(&mut self) -> Option<String>
pub fn scan_template_continuation(&mut self) -> Option<Token>
pub fn source_from_pos(&self) -> String
pub fn advance_char(&mut self) -> Option<char>
pub fn at_str(&self, s: &str) -> bool
Auto Trait Implementations§
impl Freeze for Lexer
impl RefUnwindSafe for Lexer
impl Send for Lexer
impl Sync for Lexer
impl Unpin for Lexer
impl UnsafeUnpin for Lexer
impl UnwindSafe for Lexer
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