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

Single-line comments can't appear after case name #282

Closed
pdubroy opened this issue Jan 13, 2021 · 0 comments
Closed

Single-line comments can't appear after case name #282

pdubroy opened this issue Jan 13, 2021 · 0 comments

Comments

@pdubroy
Copy link
Contributor

pdubroy commented Jan 13, 2021

Reported by udob on Discord:

I think I found a problem with line comments in grammars. Checkout this example:

Arithmetic {
  Exp 
    = AddExp        // line comment OK

  AddExp
    = AddExp "+" digit+   -- plus  // line comment after caseName FAILED
    | AddExp "-" digit+   -- minus
    | digit+
}

The second line comment produces a syntax error (expected "}" or "\n"). Changing the line comment to a /* ...*/ makes the error go away.

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

No branches or pull requests

1 participant