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

happyExpToks table can be larger than happyTable #271

Closed
sgraf812 opened this issue Jan 26, 2024 · 2 comments · Fixed by #318
Closed

happyExpToks table can be larger than happyTable #271

sgraf812 opened this issue Jan 26, 2024 · 2 comments · Fixed by #318
Milestone

Comments

@sgraf812
Copy link
Collaborator

For tests/issue93.y, the happyExpToks array is about 20% larger than happyTable. We should definitely try to compress it more, perhaps use an array of lists. Better: Error handling is not required to be fast; just reconstruct the expected tokens from the happyTable.

@int-index
Copy link
Collaborator

Error handling is not required to be fast

Are you sure? GHC relies on the error token to implement the layout rule.

@sgraf812
Copy link
Collaborator Author

sgraf812 commented Mar 6, 2024

Yes, in #272 I produce the expected tokens lazily when the error handler (reportError, in the example) needs them. For the error token, this error handler will not even be called, unless there really is a syntax error.

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 a pull request may close this issue.

2 participants