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

[TS] add missing channel constants #4579

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

ericvergnaud
Copy link
Contributor

The title says it all

Fixes #4572

@ericvergnaud ericvergnaud requested a review from kaby76 April 7, 2024 08:31
@kaby76
Copy link
Contributor

kaby76 commented Apr 7, 2024

Thank you. This fixes the problem.

Note, there are still missing methods for lexer commends, like setChannel(). Some of the set/get methods, which are in Java, are inconsistent in TypeScirpt. For example, _type in TypeScript is a public field, whereas in Java there are get and set methods to hide direct access.

But, I wonder about text in TypeScript vs _text in JavaScript, whereas in setText() in Java sets _text. There is no this.text in the JS code.

The fields in the lexer object are used when calling emit().

I can work around the lexer interface by directly manipulating the token itself by overriding emit().

@ericvergnaud
Copy link
Contributor Author

@kaby76 can you file separate issues/PRs for these other missing items ?

@ericvergnaud ericvergnaud merged commit 360c86c into antlr:dev Apr 8, 2024
41 of 42 checks passed
@ericvergnaud ericvergnaud deleted the add-missing-channel-constants branch April 8, 2024 07:19
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.

Tool does not generate any constants for channels for the TypeScript target
2 participants