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

Add override specifier to typescript copyfrom codegen #4559

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

Phlosioneer
Copy link
Contributor

Required for "noImplicitOverride": true typescript setting.

I couldn't figure out how to add a test for this situation in the typescript test file. It only happens if a rule context class has a subclass.

Required for `"noImplicitOverride": true` typescript setting.

I couldn't figure out how to add a test for this situation in the typescript
test file. It only happens if a rule context class has a subclass.

Signed-off-by: Phlosioneer <[email protected]>
@ericvergnaud
Copy link
Contributor

I think it happens when you have labeled alternatives, such as:

generic_rule:
 specific_rule_1 # SepecificRule1
 | specific_rule_2 # SepecificRule2
 ;

We already have tests for these (for example runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_1.txt), which leads me to suspect that the need for this comes from tsconfig ? Or a specific version of tsc ?

@Phlosioneer
Copy link
Contributor Author

It is a tsconfig setting:

Required for "noImplicitOverride": true typescript setting.

I don't see where the expected typescript translation of that test file lives...? Is the generated parser source compared against a real file, or is it just a "does it generate and run" test?

@ericvergnaud
Copy link
Contributor

The test sample is used to generate a unit test for each target. You'd need to follow the build instructions to actually see the corresponding code since it's dynamically generated.

@ericvergnaud ericvergnaud merged commit 4a1963b into antlr:dev Mar 19, 2024
41 of 42 checks passed
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