Add lexeme 'first' field, refactor and add methods
This commit is contained in:
parent
e42c67676d
commit
c53afefb67
9 changed files with 98 additions and 50 deletions
|
|
@ -31,7 +31,7 @@ fn lex(text: &str, map: LexMap, config: &Config) -> Vec<Token> {
|
|||
|
||||
let mut iterator = lexemes.iter().peekable();
|
||||
while let Some(lexeme) = iterator.next() {
|
||||
if lexeme.match_as_char('\\') {
|
||||
if lexeme.match_char('\\') {
|
||||
if let Some(next) = iterator.next() {
|
||||
tokens.push(Token::Literal(Literal::lex(next)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue