rascal
rascal copied to clipboard
Parse method is "already defined" due to non-terminal labels?
I ran into this error because of a stupid copy-and-paste error:
Statement -> _with: 'WITH' "(" {Shorthand shorthand ","}+ ")" Eol ignore StatementBlock body 'ENDWITH'
This results in a cryptic "method Shorthand() is already defined" error. Of course the fix is easy:
Statement -> _with: 'WITH' "(" {Shorthand ","}+ shorthands ")" Eol ignore StatementBlock body 'ENDWITH'
Originally posted by @PieterOlivier in https://github.com/usethesource/rascal/issues/901#issuecomment-1100820959
I have some clarification questions before I can triage this bug. @PieterOlivier, did the following happen:
- You had
{Shorthand shorthand ","}+in your rule and that resulted "method already defined" compilation errors? - You changed it to
{Shorthand ","}+ shorthandsand the bug dissappeared?
- Yes
- Yes
One more question, is there another rule that contains Shorthand shorthand as a symbol in the grammar? and if so, what does it look like?
oeps. wrong issue number in commit.