A universal source code scanner
/!\ work-in-progress
```rust const LUACONFIG: ScannerConfig = ScannerConfig { keywords: &[ "and", "break", "do", "else", "elseif", "end", "false", "for", "function", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while", ], symbols: &[ "...", "..", "==", "~=", "<=", ">=", "+", "-", "*", "/", "%", "^", "#", "<", ">", "=", "(", ")", "{", "}", "[", "]", ";", ":", ",", ".", ], singlelinecmt: Some("--"), multilinecmtstart: Some("--[["), multilinecmt_end: Some("]]"), };
let mut scannerdata = ScannerData::default(); let mut scanner = Scanner::default(); scanner.run(sourcecode, &LUACONFIG, &mut scannerdata)?; ```
=> you can now use the ScannerData struct in your parser to build your AST :
```rust pub enum TokenType { Symbol(String), Identifier(String), StringLiteral(String), NumberLiteral(String, Number), Keyword(String), Comment(String), // space Ignore, NewLine, Eof, Unknown, }
pub struct ScannerData {
/// complete source code
pub source: Vec