Skip to content
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: Remove getNextToken method #461

Merged
merged 4 commits into from Mar 17, 2022
Merged

refactor: Remove getNextToken method #461

merged 4 commits into from Mar 17, 2022

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.

None yet

2 participants