mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibWeb: Allow peeking more than 1 token ahead in CSS Parser
This commit is contained in:
committed by
Andreas Kling
parent
919eb7c0aa
commit
d6668dbc56
@@ -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();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user