AK: Standardize the behaviour of GenericLexer::consume_until overloads

Before this commit all consume_until overloads aside from the Predicate
one would consume (and ignore) the stop char/string, while the
Predicate overload would not, in order to keep behaviour consistent,
the other overloads no longer consume the stop char/string as well.
This commit is contained in:
Idan Horowitz 2022-01-24 23:47:22 +02:00 committed by Ali Mohammad Pur
commit 67ce9e28a5
Notes: sideshowbarker 2024-07-17 20:16:10 +09:00
7 changed files with 18 additions and 14 deletions

View file

@ -88,10 +88,12 @@ parse_state_machine(StringView input)
num = 16 * num + get_hex_value(c);
} else {
lexer.consume_specific('\'');
if (lexer.next_is('\\'))
if (lexer.next_is('\\')) {
num = (int)lexer.consume_escaped_character('\\');
else
} else {
num = lexer.consume_until('\'').to_int().value();
lexer.ignore();
}
lexer.consume_specific('\'');
}
return num;