1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

LibWeb: Add TokenStream class to CSS Parser

The entry points for CSS parsing in the spec are defined as accepting
any of a stream of Tokens, or a stream of ComponentValues, or a String.
TokenStream is an attempt to reduce the duplication of code for that.
This commit is contained in:
Sam Atkins 2021-07-03 14:00:41 +01:00 committed by Andreas Kling
parent 6c03123b2d
commit b7116711bf
4 changed files with 119 additions and 47 deletions

View file

@ -70,6 +70,8 @@ public:
[[nodiscard]] Vector<Token> parse();
[[nodiscard]] static Token create_eof_token();
private:
[[nodiscard]] u32 next_code_point();
[[nodiscard]] u32 peek_code_point(size_t offset = 0) const;