mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:07:34 +00:00
LibWeb: Allow peeking more than 1 token ahead in CSS Parser
This commit is contained in:
parent
919eb7c0aa
commit
d6668dbc56
2 changed files with 3 additions and 3 deletions
|
@ -73,12 +73,12 @@ bool TokenStream<T>::has_next_token()
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T const& TokenStream<T>::peek_token()
|
T const& TokenStream<T>::peek_token(int offset)
|
||||||
{
|
{
|
||||||
if (!has_next_token())
|
if (!has_next_token())
|
||||||
return m_eof;
|
return m_eof;
|
||||||
|
|
||||||
return m_tokens.at(m_iterator_offset + 1);
|
return m_tokens.at(m_iterator_offset + offset + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
|
|
||||||
bool has_next_token();
|
bool has_next_token();
|
||||||
T const& next_token();
|
T const& next_token();
|
||||||
T const& peek_token();
|
T const& peek_token(int offset = 0);
|
||||||
T const& current_token();
|
T const& current_token();
|
||||||
void reconsume_current_input_token();
|
void reconsume_current_input_token();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue