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

[postgresql] Fixes for #4321, #4322 #4323

Merged
merged 2 commits into from
Nov 17, 2024
Merged

[postgresql] Fixes for #4321, #4322 #4323

merged 2 commits into from
Nov 17, 2024

Conversation

kaby76
Copy link
Contributor

@kaby76 kaby76 commented Nov 11, 2024

This PR fixes #4321 and #4322.

For #4321, the grammar rule typename was refactored from the gram.y. The second alt was removed because it added ambiguity.

For #4322, a_expr_caret was corrected to follow the usual Floyd operator precedence grammar pattern. The input SELECT 1 * 2 ^ 3 + 4; is no longer ambiguous.

Several other rules were corrected to remove some of the lingering pl/pgsql grammar rules, which caused ambiguity in col_name_keyword and c_expr.

As I progress in the clean up of this grammar, keep an eye on the list of rules with ambiguity. Before I started a couple of weeks ago, the list of ambiguous rules was this:

a_expr_add
a_expr_and
a_expr_compare
a_expr_qual_op
alter_table_cmd
c_expr
col_name_keyword
colid
collabel
createfunc_opt_list
frame_bound
from_list
func_type
group_by_item
into_clause
opt_analyze
opt_target_list
optschemaeltlist
reindexstmt
select_with_parens
selectstmt
stmt
table_ref
tableelement
type_function_name
zone_value

It is now this:

a_expr_and
a_expr_compare
c_expr
frame_bound
group_by_item
select_with_parens
selectstmt
table_ref

The readme was updated to reflect fixes to the grammar that removed Antlr Tool warnings.

@teverett
Copy link
Member

@kaby76 thanks

@teverett teverett merged commit 7965202 into antlr:master Nov 17, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[postgresql] typename incorrectly refactored from official PostgreSQL grammar.
2 participants