mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 23:28:11 +00:00
AK: Remove ByteString from GenericLexer
A bunch of users used consume_specific with a constant ByteString literal, which can be replaced by an allocation-free StringView literal. The generic consume_while overload gains a requires clause so that consume_specific("abc") causes a more understandable and actionable error.
This commit is contained in:
parent
7c88ab2836
commit
eada4f2ee8
16 changed files with 89 additions and 86 deletions
|
@ -89,19 +89,19 @@ Configuration Configuration::from_config(StringView libname)
|
|||
escape = false;
|
||||
} else {
|
||||
if (key_lexer.next_is("alt+")) {
|
||||
alt = key_lexer.consume_specific("alt+");
|
||||
alt = key_lexer.consume_specific("alt+"sv);
|
||||
continue;
|
||||
}
|
||||
if (key_lexer.next_is("^[")) {
|
||||
alt = key_lexer.consume_specific("^[");
|
||||
alt = key_lexer.consume_specific("^["sv);
|
||||
continue;
|
||||
}
|
||||
if (key_lexer.next_is("^")) {
|
||||
has_ctrl = key_lexer.consume_specific("^");
|
||||
has_ctrl = key_lexer.consume_specific("^"sv);
|
||||
continue;
|
||||
}
|
||||
if (key_lexer.next_is("ctrl+")) {
|
||||
has_ctrl = key_lexer.consume_specific("ctrl+");
|
||||
has_ctrl = key_lexer.consume_specific("ctrl+"sv);
|
||||
continue;
|
||||
}
|
||||
if (key_lexer.next_is("\\")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue