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

Allow derivation which starts with "e" character #5

Merged
merged 3 commits into from
Mar 18, 2020

Conversation

Matts966
Copy link
Contributor

@Matts966 Matts966 commented Jan 26, 2020

For example, the syntax definition below causes an error.

syntax E (S) {
  Example : S  -> examples
  ExampleDerivations : examples -> examples example
  ExampleDerivation : example -> "example"
}

The error is like

typelevelLR: "e.syntax" (line 2, column 19):
unexpected "x"
expecting "eps"
CallStack (from HasCallStack):
  error, called at src/Generate.hs:31:22 in typelevelLR-0.1.0.0-7M2UNcQMvFw1r8bPLfq4Us:Generate

This is caused by the higher priority of "eps" rule than others.

So by making the priority of "eps" lower than other rules, we can allow rules which start with 'e' character.

I already ensured that the parser with this change can treat such a case without error.

Thank you :)

Update on 2/10: Fix bugs caused by recognizing eps as a terminal symbol by using backtracking and confirmed all the tests passed in the container developed in #6. Sorry for my incomplete check. Any additional requests are welcome.

@ymzk ymzk merged commit ca58538 into csg-tokyo:master Mar 18, 2020
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.

2 participants