mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
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:
parent
d49d2c7ec4
commit
67ce9e28a5
Notes:
sideshowbarker
2024-07-17 20:16:10 +09:00
Author: https://github.com/IdanHo
Commit: 67ce9e28a5
Pull-request: https://github.com/SerenityOS/serenity/pull/12120
Reviewed-by: https://github.com/alimpfard ✅
7 changed files with 18 additions and 14 deletions
|
@ -31,6 +31,7 @@ static bool parse_name(StringView name, OpenFile& file)
|
|||
{
|
||||
GenericLexer lexer(name);
|
||||
auto component1 = lexer.consume_until(':');
|
||||
lexer.ignore();
|
||||
|
||||
if (lexer.tell_remaining() == 0) {
|
||||
file.name = component1;
|
||||
|
@ -50,6 +51,7 @@ static bool parse_name(StringView name, OpenFile& file)
|
|||
}
|
||||
|
||||
auto component3 = lexer.consume_until(')');
|
||||
lexer.ignore();
|
||||
if (lexer.tell_remaining() != 0) {
|
||||
dbgln("parse_name: expected EOF");
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue