mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +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
Notes:
sideshowbarker
2024-07-18 09:13:03 +09:00
Author: https://github.com/AtkinsSJ
Commit: 86994336a7
Pull-request: https://github.com/SerenityOS/serenity/pull/8341
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