-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[postgresql] Fix for #4324; add ports. #4325
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warnings fixed.
The TypeScript port generates `any_name._list()` accessor method for alts with multiple `any_name` references. This conflicts with the symbol reference `any_name_list`, which is another production.
(Requires #4323 to be merged first.) |
(Finally a clean build. Failures had nothing to do with this PR. It's all a matter of chance. See #4326.) |
@kaby76 thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #4324. The grammar was not "target agnostic" and there were just two targets implemented. With this change almost all targets are supported. I didn't bother with the implementation of the PHP port because it is very slow in general and contains errors in ATN Config hash value and equality computions. This problem becomes accute with ambiguity and fallbacks. I also didn't write the Swift port because I don't develop on MacOS.
Target Agnostic is a specific coding style for .g4 files to allow any target to be generated from one copy of the .g4 files: All
@members
and@headers
are replaced with a comment; Actions{ ... }
and{ ... }?
contain only parameterless method calls with athis.
prefix;transformGrammar.py
is used to modify the .g4s just prior calling the Antlr Tool specific for the target because there are still minor variations for targets from the established format. The purpose of Target Agnostic is to avoid the major problem of keeping multiple copies of the .g4 files in synch across ports.The following ports were added: Antlr4ng, Cpp, Dart, Go, JavaScript, Python3, TypeScript. Existing ports are: CSharp, Java. Note, the Go port became out of synch because it was not plugged into the build. It now works.
Notes
if
-statement.{ }
in these rules because the code does not compile for Python3.