[CSharp] CI build of Antlr CSharp runtime gives warnings
See original GitHub issueI don’t recall seeing this before, but under the “Files changed” tab for a PR, we now see warnings for legitimate build issues of the C# code.
Check warning on line 25 in runtime/CSharp/src/Tree/Xpath/XPathLexer.cs
GitHub Actions
/ build (csharp)
runtime/CSharp/src/Tree/Xpath/XPathLexer.cs#L25
The using directive for 'System' appeared previously in this namespace
See https://github.com/antlr/antlr4/pull/3547/files
It’s caused because the grammar file XPathLexer.g4 includes an @header { using System;}
. The @header
is not needed. But, Char.IsUpper()
should be fully qualified in order to eliminate the assumption that System is included. Honestly, the grammar shouldn’t have target-specific actions in the code, and should be in “target-agnostic format”. But, that’s another story.
But, it gets better…
The XPathLexer.cs is generated by the Antlr4 tool. It says that it was generated using 4.9.3, but it was not! I don’t know what tool was used, but it’s not the official 4.9.3 Antlr tool! The tables produced are different.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (12 by maintainers)
Top GitHub Comments
Also, it is not covered by tests except for Java.
I support the idea of dropping XPath from ANTLR core at all since it’s outdated and is not supported by some runtimes.