Skip to content

Conversation

@fb55
Copy link
Collaborator

@fb55 fb55 commented Mar 16, 2022

Removes the getNextToken function of the tokenizer, as well as all parsing loops. getNextToken was already a bit of a misnomer, as it would emit tokens to token handlers instead of returning it to the caller. Turns out parsing loops aren't necessary anymore, so let's get rid of them.

Script handling had to be updated slightly to support this. Now, a script handler is supplied to the parser constructor, and will be called whenever a script is encountered. This simplifies script handling logic in a few places.

Copy link
Collaborator

@wooorm wooorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I don’t see anything weird :)

@fb55 fb55 merged commit dc5a0a6 into master Mar 17, 2022
@fb55 fb55 deleted the refactor/getnexttoken branch March 17, 2022 11:01
jmbpwtw pushed a commit to jmbpwtw/parse5 that referenced this pull request Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants