-
Notifications
You must be signed in to change notification settings - Fork 108
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
Generated code fails to compile #395
Comments
I can't figure out how this method is getting generated. Can you include a copy of Rule.g4? Edit: This is probably caused by having a rule in the grammar itself named
Can you provide an example of this? Edit: moved this item to #396 |
Unfortunately I can not, but as soon as I read your response I realized what the mistake is. The grammar is sports related and has a To prevent such occurances in the future you could consider adding a prefix to the base class methods, or to the derived class methods, or perhaps even use symbols to hide the base class implementation. Regardless this issue is closed, as it was my own fault. :-) I've also added an example to #396. |
=. =, same problem appears to me, and after read this .........What fool am I....... |
Versions used:
Steps performed:
Issues:
The lexer, the listener and the visitor seem to compile fine, but the
RuleParser.ts
file contains several compilation errors.this.match(argument)
is called, but implementation does not accept any arguments.RuleParser.match()
and base classParser.match(..)
do not match in arguments and return type.this
can't be passed as an argument to methods accepting aParser
(possibly because for the previous issue).The first two errors can be solved by renaming the
match()
method in the derived class to something likematchNoArgs()
and replace all calls to the parameterlessmatch
method with the new name. I guess as part of some re-working the name got accidentally re-used (JavaScript does not support method overloading).The last error can be solved by turning
strictPropertyInitialization
off in the TypeScript configuration.After that I run into the same issue as #394 and hope for support of #311.
The text was updated successfully, but these errors were encountered: