Skip to content
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

[plsql] Fix for #3646 -- removed warning "rule json_function contains an optional block with at least one alternative that can match an empty string" #3648

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

kaby76
Copy link
Contributor

@kaby76 kaby76 commented Aug 7, 2023

This is a fix for #3646.

In this PR, the json_function rule contains the expression json_query_returning_clause?, which causes the warning "rule json_function contains an optional block with at least one alternative that can match an empty string". It turns out that json_query_returning_clause is nullable. The Spec contains the same error. https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/JSON_QUERY.html#GUID-6D396EC4-D2AA-43D2-8F5D-08D646A4A2D9

Until the Spec is fixed, the ?-operator on json_query_returning_clause should be removed. The alternative is to rewrite json_query_returning_clause so that is not nullable, a more complicated task.

I added a test to make sure json_query_returning_clause is used. (It was not up to this point. See attached cover.html).

Until the Spec is fixed, remove the ?-operator on json_query_returning_clause.
@kaby76 kaby76 changed the title [plsql] Fix for #3646 [plsql] Fix for #3646 -- remove warning "rule json_function contains an optional block with at least one alternative that can match an empty string" Aug 8, 2023
@kaby76 kaby76 changed the title [plsql] Fix for #3646 -- remove warning "rule json_function contains an optional block with at least one alternative that can match an empty string" [plsql] Fix for #3646 -- removed warning "rule json_function contains an optional block with at least one alternative that can match an empty string" Aug 8, 2023
@KvanTTT KvanTTT added plsql example New example of file(s) parsed by grammar-generated parser labels Aug 8, 2023
@kaby76 kaby76 marked this pull request as ready for review August 8, 2023 16:10
@teverett
Copy link
Member

teverett commented Aug 9, 2023

@kaby76 thanks!

@teverett teverett merged commit a77a447 into antlr:master Aug 9, 2023
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example New example of file(s) parsed by grammar-generated parser plsql
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants