[postgresql] Fix for #4311 -- remove Antlr "locals", stop calling sub-parser. #4314
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 PR fixes #4311. The problem is that the .g4 grammar file used
locals [ ... ]
. This cannot work for a multi-targeted grammar. In addition, the grammar tried to parse function bodies as always Pl/SQL. It ignores the fact that it could be something else.locals [ ... ]
declaration has been removed.//NB
comments to re-implement the sub-parse in the correct way later.The grammar is now twice as fast to parse the test suite in examples/, likely because it is not parsing pl/pgsql. To consider: is it better to create the parser once and use Reset() instead of creating a parser for each pl/pgsql input?