diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-02-28 11:11:39 +0000 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-02-28 12:55:10 +0000 |
commit | c06f4ac6f58261c079721b54058989d7695ef9c3 (patch) | |
tree | 0416efe327f8b9be6b8b2ba4abf1d283335a3ac2 /AK/GenericLexer.h | |
parent | 0511059d604d7544a4af4e8ebd990c755fd1cff2 (diff) | |
download | serenity-c06f4ac6f58261c079721b54058989d7695ef9c3.zip |
AK+Everywhere: Make GenericLexer::ignore_until() stop before the value
`consume_until(foo)` stops before foo, and so does
`ignore_until(Predicate)`, so let's make the other `ignore_until()`
overloads consistent with that so they're less confusing.
Diffstat (limited to 'AK/GenericLexer.h')
-rw-r--r-- | AK/GenericLexer.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/AK/GenericLexer.h b/AK/GenericLexer.h index 508c4df3a2..d37af0608d 100644 --- a/AK/GenericLexer.h +++ b/AK/GenericLexer.h @@ -142,7 +142,6 @@ public: while (!is_eof() && peek() != stop) { ++m_index; } - ignore(); } constexpr void ignore_until(char const* stop) @@ -150,7 +149,6 @@ public: while (!is_eof() && !next_is(stop)) { ++m_index; } - ignore(__builtin_strlen(stop)); } /* @@ -205,8 +203,7 @@ public: ++m_index; } - // Ignore characters until `pred` return true - // We don't skip the stop character as it may not be a unique value + // Ignore characters until `pred` returns true template<typename TPredicate> constexpr void ignore_until(TPredicate pred) { |