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
parent b2daaca5ee
commit 39a9cf4bb4

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