GoSuB Browser Progress, pt12

Created at 2023-09-11 10:27:49 (5 months ago)

So i've got an arena which is part of a document (tree) so all the nodes are stored there, and we reference nodes through their node_id (which is a sequential node number).

I've also did some work on testing the tree with html5lib-tests. One of the issues I find is that the html5 spec outlines the tokenizer is great detail, including which error messages to throw, but lacks a bit with the parsing spec. For instance, it speaks a lot about throwing parser errors, but doesn't specify which error to throw. So probably this is not specified directly, but the html5lib-tests assumes certain errors at certain places. This means we should incorporate the html5lib error messages in our parser as well, in order to make sure we can test the system.

So, for now it will be a long way of tweaking the parser, getting rid of all the bugs, filling in some of the functionality (still: what the hell is foster parenting!?), and making sure we return the document-tree that we expect in the tests.

This is gonna take a while....

Oh, another thing that I'm struggling with: The html5parser struct instantiates a tokenizer struct which it uses. So far so good: as long as I have the parser, I have the tokenizer. Rust will take care of that. However, both should use a parse_error() method that will add parser AND tokenizer errors onto a single stack. This causes problems, as we can't really define the owner of the logger, and rust will get angry at us. So instead i create a separate error logger and attach them to both structs with Rc<RefCell<ErrorLogger>>. Is this the way?

rust gosub html5 parser

About jaytaph

Codemuser extraordinaire

avatar Loves building crazy and insane stuff. Happiest when left alone. All I wanted was a Pepsi, just a Pepsi.
Joined:March 24, 2023
RSS feed