mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +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:
parent
98ee2fcd1b
commit
17618989a3
5 changed files with 47 additions and 44 deletions
|
@ -58,15 +58,16 @@ public:
|
|||
};
|
||||
|
||||
class Tokenizer {
|
||||
|
||||
public:
|
||||
explicit Tokenizer(StringView input, StringView encoding);
|
||||
|
||||
[[nodiscard]] Vector<Token> parse();
|
||||
static ErrorOr<Vector<Token>> tokenize(StringView input, StringView encoding);
|
||||
|
||||
[[nodiscard]] static Token create_eof_token();
|
||||
|
||||
private:
|
||||
explicit Tokenizer(String decoded_input);
|
||||
|
||||
[[nodiscard]] Vector<Token> tokenize();
|
||||
|
||||
[[nodiscard]] u32 next_code_point();
|
||||
[[nodiscard]] u32 peek_code_point(size_t offset = 0) const;
|
||||
[[nodiscard]] U32Twin peek_twin() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue