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

Parser API design #89

Merged
merged 21 commits into from
Jun 25, 2023
Merged

Parser API design #89

merged 21 commits into from
Jun 25, 2023

Conversation

teo-tsirpanis
Copy link
Owner

No description provided.

This will allow accessing the context object from the `ParserState` instead of the `ParserInputReader`. The latter's `StateBox` property was removed.
The context can automatically return the character buffers all characters have been read and input has completed.
They can put a strain on the implementers and are not strictly necessary.
Farkle 6 has a `Cast()` method for runtime Farkles which we might port.
And I liked this idea so much. 😭
The problem with it is that it restricts the API by prohibiting upcasting operations on parser and builder objects, and has a questionable advantage (zero allocations with the calculator)?
Thankfully I just thought of a way to reintroduce an optimization like this in the future.
Add `InputName` and make it and the `Context` get/set instead of get/init; you cannot init the parser state of a `ParserStateContext`.
It's not supposed to be modified by user code and `ParserStateContext` will still be able to set it to itself.
@teo-tsirpanis teo-tsirpanis marked this pull request as ready for review June 24, 2023 23:49
@teo-tsirpanis teo-tsirpanis mentioned this pull request Jun 24, 2023
4 tasks
@sonarcloud
Copy link

sonarcloud bot commented Jun 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@teo-tsirpanis teo-tsirpanis merged commit f5a1e12 into mainstream Jun 25, 2023
6 checks passed
@teo-tsirpanis teo-tsirpanis deleted the parser-design branch June 25, 2023 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant