pub struct Lexer {
pub keywords: Vec<String>,
pub sections: Vec<Section>,
pub symbols: Vec<(char, String)>,
pub buffer: Vec<u8>,
pub allow_whitespace: bool,
}Fields§
§keywords: Vec<String>§sections: Vec<Section>§symbols: Vec<(char, String)>§buffer: Vec<u8>§allow_whitespace: boolImplementations§
source§impl Lexer
impl Lexer
pub fn new( keywords: &[String], sections: &[Section], symbols: &[(char, String)], allow_whitespace: bool ) -> Lexer
pub fn load_str(&mut self, string: &str)
pub fn load_file(&mut self, filename: &str) -> Result<(), Box<dyn Error>>
pub fn tokenize(&mut self) -> Result<Vec<Token>, Box<dyn Error>>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Lexer
impl Send for Lexer
impl Sync for Lexer
impl Unpin 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