mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-10 13:12:56 +00:00
LibWeb: Start building the tree building part of the new HTML parser
This patch adds a new HTMLDocumentParser class. It keeps a tokenizer object internally and feeds itself with one token at a time from it. The names and idioms in this class are expressed as closely to the actual HTML parsing spec as possible, to make development as easy and bug free as possible. :^) This is going to become pretty large, but it's pretty cool!
This commit is contained in:
parent
0b61e21873
commit
fd1b31d0ff
Notes:
sideshowbarker
2024-07-19 06:12:03 +09:00
Author: https://github.com/awesomekling
Commit: fd1b31d0ff
8 changed files with 515 additions and 76 deletions
|
@ -118,14 +118,13 @@ class HTMLTokenizer {
|
|||
public:
|
||||
explicit HTMLTokenizer(const StringView& input);
|
||||
|
||||
void run();
|
||||
Optional<HTMLToken> next_token();
|
||||
|
||||
private:
|
||||
Optional<u32> next_codepoint();
|
||||
Optional<u32> peek_codepoint(size_t offset) const;
|
||||
bool next_few_characters_are(const StringView&) const;
|
||||
void consume(const StringView&);
|
||||
void emit_current_token();
|
||||
void create_new_token(HTMLToken::Type);
|
||||
|
||||
enum class State {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue