mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39: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
Notes:
sideshowbarker
2024-07-17 01:21:02 +09:00
Author: https://github.com/kleinesfilmroellchen
Commit: eada4f2ee8
Pull-request: https://github.com/SerenityOS/serenity/pull/21388
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/timschumi
16 changed files with 89 additions and 86 deletions
|
@ -166,7 +166,7 @@ EasingFunctionMetadata easing_function_metadata(EasingFunction easing_function)
|
|||
auto parameter_type_name = lexer.consume_until([](char ch) { return ch == ' ' || ch == '>'; });
|
||||
auto has_bounds = false;
|
||||
auto is_optional = false;
|
||||
if (lexer.consume_specific(" [")) {
|
||||
if (lexer.consume_specific(" ["sv)) {
|
||||
has_bounds = true;
|
||||
auto contents = lexer.consume_until(']');
|
||||
VERIFY(contents == "0, 1"sv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue