Understanding Runtime Tests #4520
Closed
mike-lischke
started this conversation in
General
Replies: 1 comment
-
Oh, I just realized that slave grammars in the tests are not used to generate their own parser files, but are imported and contribute to their importing grammar. In that scenario there's obviously no check performed which disallows grammar rules that should not be in a grammar (like in this case). For simplicity I ran ANTLR for all *.g4 files in a test dir, which also generated files for imported grammars. Hence the errors. Though, I think imported grammars should experience the same checks like standalone grammars. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently porting ANTLR4's runtime tests to TypeScript and got some errors that I expected to show up also when running the Java runtime tests (but they don't). For example check this descriptor.
It contains a slave grammar description:
which is a parser grammar, but contains a lexer rule. It's clear that this throws errors:
but what baffles me is that it seems to work without problems in Java. How can that be? Can any of the other experts @parrt, @kaby76, @KvanTTT, @ericvergnaud please explain this? Do I overlook something here (maybe an expected error)?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions