mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 16:46:08 +00:00
AK: Add a retreat(count) method to GenericLexer
This method can be used to rewind a constant amount backwards in the source instead of one by one with retract()
This commit is contained in:
parent
b2daaca5ee
commit
39a9cf4bb4
Notes:
sideshowbarker
2024-07-18 09:10:27 +09:00
Author: https://github.com/IdanHo
Commit: 39a9cf4bb4
Pull-request: https://github.com/SerenityOS/serenity/pull/8663
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/linusg
1 changed files with 6 additions and 0 deletions
|
@ -56,6 +56,12 @@ public:
|
|||
--m_index;
|
||||
}
|
||||
|
||||
constexpr void retreat(size_t count)
|
||||
{
|
||||
VERIFY(m_index >= count);
|
||||
m_index -= count;
|
||||
}
|
||||
|
||||
constexpr char consume()
|
||||
{
|
||||
VERIFY(!is_eof());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue