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

Merge error_recovery branch #44

Merged
merged 16 commits into from Jun 16, 2023
Merged

Conversation

alitaso345
Copy link
Contributor

Summary

  • yui-knk-san has already implemented an error recovery mode, however, the 'error_recovery' branch has not yet been merged.
  • In this pull request, we will merge the 'error_recovery' branch, thereby enabling the retrieval of error recovery tokens.

Changes Made

  • The 'error_recovery' branch from the repository https://github.com/ruby/lrama/tree/error_recovery has been merged.
  • template/bison/yacc.c file has been modified to ensure successful compilation
    • Added user arguments to functions and macros used by bison.

@yui-knk
Copy link
Collaborator

yui-knk commented Jun 16, 2023

Thanks for reviving the branch! I will merge this PR :)

These are future work we may need to tackle

  1. Determine an interface for enable/disable error recovery
    Error recovery is not zero cost. Therefore it might be disabled in many cases and enabled for some cases, e.g. when parser is used as backend of LSP. There are two options for this point.
  1. Add lrama command line option or %error-recovery declaration.
  2. Update yyparse or add callback function to determine error recovery enablement on runtime.

Option 1 is static then we need to build two parser in ruby/ruby. On the other hand option 2 is dynamic, so single parser can handle both use cases. I prefer option 2.

  1. Determine an interface for max number of trial
    At the moment YYMAXREPAIR macro controls the upper limit of insert operation so that the upper limit is determined on compile time. I think it's useful if the upper limit is configurable on runtime.

@yui-knk yui-knk merged commit 31f14d0 into ruby:master Jun 16, 2023
9 checks passed
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