mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
LibWeb: Correct parsing invalid list of declarations
We were only discarding at most one token when a declaration is invalid, when we should discard all until we see a ; or EOF.
This commit is contained in:
parent
c249fbd17c
commit
86994336a7
1 changed files with 3 additions and 1 deletions
|
@ -890,8 +890,10 @@ Vector<DeclarationOrAtRule> Parser::consume_a_list_of_declarations(TokenStream<T
|
|||
log_parse_error();
|
||||
tokens.reconsume_current_input_token();
|
||||
auto peek = tokens.peek_token();
|
||||
if (!(peek.is(Token::Type::Semicolon) || peek.is(Token::Type::EndOfFile))) {
|
||||
while (!(peek.is(Token::Type::Semicolon) || peek.is(Token::Type::EndOfFile))) {
|
||||
dbgln("Discarding token: '{}'", peek.to_debug_string());
|
||||
(void)consume_a_component_value(tokens);
|
||||
peek = tokens.peek_token();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue