Fix for #3125 -- Add Antlr4 PHP target testing #3699
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix for #3125 -- the PHP target is not being tested.
Testing of the PHP target was removed long ago, and never added back. In this PR, I added testing for the PHP target to the build. The driver templates for testing were updated so that the version of the Antlr tool is extracted from composer.json. Both Bash and Pwsh templates work, but I only added testing in Github Actions only for the Bash. After all, why duplicate testing and waste more money?
Attached is the test for the PHP target against the entire repo. Only python/python3 and sql/snowflake failed.
out.txt
In the case of python3, the problem is that there is no port for PHP. For snowflake, the grammar contains a symbol collision (PHP id's are case insensitive). But, even renaming one of the symbols, REFRESH_ON_CREATE, the grammar is so slow as to be unusable.
Because I touched python/python3/ to remove PHP testing for it, the TypeScript target broke. That's because there was a change (really a fix) to the Antlr4 TypeScript target runtime API for the constructor of CommonToken. I fixed the code and reset the desc.xml to make sure people know only Antlr 4.13.1 can be used with the grammar.