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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up "newparser" so it can be used properly #423

Merged
merged 7 commits into from
May 30, 2024

Conversation

AtkinsSJ
Copy link
Collaborator

I picked the name Parsely arbitrarily, so I can change it if anyone objects too much. 馃槅

This is mostly rearranging and renaming existing code and files, but a couple of things were added, fixed, or improved.

We're going to actually use this so let's give it a more permanent name.
- lib.js only holds Parser so rename it parser.js
- Move Symbol and None into terminals.js
- Briefly document all parser classes
Not consuming all input is now treated as an error, unless the
`must_consume_all_input` flag is set to false when parsing.
THe `a.stringOf(' \r\n\t'.split('')),` pattern works fine for small sets
of characters, but is horrible for situations like "any alphanumeric".
Instead, let's make it take a callback function that is run on each
character.
This now can parse JSON correctly in various configurations.
@KernelDeimos KernelDeimos merged commit 895358e into HeyPuter:main May 30, 2024
6 checks passed
@AtkinsSJ AtkinsSJ deleted the parsely branch May 31, 2024 08:07
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