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

Bug: Generate valid input for rule ignores negation #240

Open
corneliusroemer opened this issue Dec 19, 2023 · 0 comments
Open

Bug: Generate valid input for rule ignores negation #240

corneliusroemer opened this issue Dec 19, 2023 · 0 comments
Labels
possible bug Could be a bug

Comments

@corneliusroemer
Copy link

I'm just getting started with ANTLR4 and I love the extension.

I've used the "ANTLR: Generate valid input for rule" action from the command palette quite a bit. It's useful to learn the ANTLR syntax.

Unfortunately, I think that there's a serious bug that makes negation ignored.

The following ANTLR lexer rule should produce anything but a, but in fact it produces just a. Whether or not I add the ~ doesn't matter, the result is the same. This shouldn't be the case:

grammar Bug;

// Show that negating doesn't work
init: A NOT_A;

A: 'a';
NOT_A: ~'a';

2023-12-19 02 02 17

The railroad diagram is correct, but the generated "valid input" isn't.

@mike-lischke mike-lischke added the possible bug Could be a bug label Dec 19, 2023
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