Implement escaping

This commit is contained in:
Juno Takano 2026-01-07 01:02:57 -03:00
commit c6b43b2c48
4 changed files with 18 additions and 2 deletions

View file

@ -31,6 +31,13 @@ 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 let Some(next) = iterator.next() {
tokens.push(Token::Literal(Literal::lex(next)));
}
continue;
}
if context::block::parse(
lexeme,
&mut state,