mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:57:45 +00:00
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.
This commit is contained in:
parent
0511059d60
commit
c06f4ac6f5
5 changed files with 13 additions and 16 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue