-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(parser): Invert event processing #405
Conversation
This reverts commit 95b9fe4.
We will stop parsing — no need to do this anymore
I'm not super happy with the new names, but they are an improvement.
One thing I am currently unhappy about is the
If someone can come up with better names, I'm am more than happy to take them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn’t this a deviation from how the spec is written? Seems like that’ll cause future problems.
parse5 already has a split for specific token handlers that doesn't exist in the spec. The splitting point was moved up by a step, which shouldn't make it harder to map the spec to the code. |
See #403 for details.
The parser currently first checks the insertion mode, and then the token type. By inverting this (checking first the token type, then the insertion mode), we prepare the parser to accept the events from #404.
This change also allowed foreign content checks to be greatly simplified.