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:
Idan Horowitz 2021-07-11 20:58:38 +03:00 committed by Linus Groh
commit 39a9cf4bb4
Notes: sideshowbarker 2024-07-18 09:10:27 +09:00

View file

@ -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());