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

Unexpected behaviour when token text has zero length #72

Open
lonely-lockley opened this issue May 12, 2024 · 0 comments
Open

Unexpected behaviour when token text has zero length #72

lonely-lockley opened this issue May 12, 2024 · 0 comments
Labels
possible-bug Could be a bug

Comments

@lonely-lockley
Copy link

When creating a new token with code like this:

var indentation = CommonToken.fromType(Lexer.INDENTATION, text);

the text variable may sometimes be an empty string (zero-length). In such cases indentation.text returns undefined. The expected behaviour is to get back the same value you put into token.

antlr4ng version 3.0.4
antlr4ng-cli version 2.0.0

@mike-lischke mike-lischke added the possible-bug Could be a bug label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible-bug Could be a bug
Projects
None yet
Development

No branches or pull requests

2 participants