mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +00:00
LibWeb: Use EOF code point instead of Optional in CSS Tokenizer
Optional seems like a good idea, but in many places we were not checking if it had a value, which was causing crashes when the Tokenizer was given malformed input. Using an EOF value along with is_eof() makes things a lot simpler.
This commit is contained in:
parent
caff7fff94
commit
985ed47a38
Notes:
sideshowbarker
2024-07-18 09:14:35 +09:00
Author: https://github.com/AtkinsSJ
Commit: 985ed47a38
Pull-request: https://github.com/SerenityOS/serenity/pull/8341
2 changed files with 96 additions and 103 deletions
|
@ -71,10 +71,10 @@ public:
|
|||
[[nodiscard]] Vector<Token> parse();
|
||||
|
||||
private:
|
||||
[[nodiscard]] Optional<u32> next_code_point();
|
||||
[[nodiscard]] Optional<u32> peek_code_point(size_t offset = 0) const;
|
||||
[[nodiscard]] Optional<U32Twin> peek_twin() const;
|
||||
[[nodiscard]] Optional<U32Triplet> peek_triplet() const;
|
||||
[[nodiscard]] u32 next_code_point();
|
||||
[[nodiscard]] u32 peek_code_point(size_t offset = 0) const;
|
||||
[[nodiscard]] U32Twin peek_twin() const;
|
||||
[[nodiscard]] U32Triplet peek_triplet() const;
|
||||
|
||||
[[nodiscard]] static Token create_new_token(Token::TokenType);
|
||||
[[nodiscard]] static Token create_value_token(Token::TokenType, String value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue