1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:07:34 +00:00

LibWeb: Allow peeking more than 1 token ahead in CSS Parser

This commit is contained in:
Sam Atkins 2021-07-28 16:27:45 +01:00 committed by Andreas Kling
parent 919eb7c0aa
commit d6668dbc56
2 changed files with 3 additions and 3 deletions

View file

@ -73,12 +73,12 @@ bool TokenStream<T>::has_next_token()
}
template<typename T>
T const& TokenStream<T>::peek_token()
T const& TokenStream<T>::peek_token(int offset)
{
if (!has_next_token())
return m_eof;
return m_tokens.at(m_iterator_offset + 1);
return m_tokens.at(m_iterator_offset + offset + 1);
}
template<typename T>

View file

@ -52,7 +52,7 @@ public:
bool has_next_token();
T const& next_token();
T const& peek_token();
T const& peek_token(int offset = 0);
T const& current_token();
void reconsume_current_input_token();