1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibWeb: Propagate errors from CSS Tokenizer construction

Instead of constructing a Tokenizer and then calling parse() on it, we
now call `Tokenizer::tokenize(...)` directly. (Renamed from `parse()`
because this is a Tokenizer, not a Parser.)
This commit is contained in:
Sam Atkins 2023-03-06 14:19:39 +00:00 committed by Andreas Kling
parent 98ee2fcd1b
commit 17618989a3
5 changed files with 47 additions and 44 deletions

View file

@ -45,8 +45,7 @@ void SyntaxHighlighter::rehighlight(Palette const& palette)
false);
};
CSS::Parser::Tokenizer tokenizer { text, "utf-8"sv };
auto tokens = tokenizer.parse();
auto tokens = CSS::Parser::Tokenizer::tokenize(text, "utf-8"sv).release_value_but_fixme_should_propagate_errors();
for (auto const& token : tokens) {
if (token.is(Parser::Token::Type::EndOfFile))
break;