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

Let parsing recover from no expression after a ; #294

Open
2 tasks
MeAmAnUsername opened this issue Apr 28, 2022 · 0 comments
Open
2 tasks

Let parsing recover from no expression after a ; #294

MeAmAnUsername opened this issue Apr 28, 2022 · 0 comments
Labels
Component: editor Priority: low Status: proposal Enhancement in the proposal stage Type: enhancement New feature or request

Comments

@MeAmAnUsername
Copy link
Owner

Summary
Let parsing recover from no expression after a ;

Todo

  • Figure out how to do this
  • Implement

Example

func example() -> int = {
  hello;
  // missing expression
}

Reason
Right now, Spoofax just stops parsing if there is no expression between semi-colons. It would be nice if it could recover and show an error like "Missing expression"

Implementation
Add a recover attribute to <Exp>; so that ending an expression with a semicolon and not starting the next expression yet can still be parsed.
Question is where exactly the {recover} should be added.

Additional info
See https://www.spoofax.dev/references/syntax/recovery/

Search terms
Recovery, parsing, grammar, semi-colon, block, body

Related issues
Other issue for making grammar more permissive: #85, #215, #280

@MeAmAnUsername MeAmAnUsername added Type: enhancement New feature or request Status: proposal Enhancement in the proposal stage Priority: low Component: editor labels Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: editor Priority: low Status: proposal Enhancement in the proposal stage Type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant