Skip to content

fix(postgresql): combine plsql_unreserved_keyword to unreserved_keyword and remove unused rules #315

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

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 40 additions & 77 deletions src/grammar/postgresql/PostgreSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,9 @@ tableelementlist
;

tableelement
: column_def
: (KW_CONSTRAINT colid)? constraintelem
| column_def
| KW_LIKE qualified_name ((KW_INCLUDING | KW_EXCLUDING) tablelikeoption)*
| (KW_CONSTRAINT colid)? constraintelem
;

typedtableelement
Expand Down Expand Up @@ -2788,28 +2788,24 @@ role_list

colid
: identifier
| unreserved_keyword
| col_name_keyword
| plsql_unreserved_keyword
;

type_function_name
: identifier
| unreserved_keyword
| plsql_unreserved_keyword
| type_func_name_keyword
;

nonreservedword
: identifier
| unreserved_keyword
| col_name_keyword
| type_func_name_keyword
;

collabel
: nonreservedword
| plsql_unreserved_keyword
: identifier
| col_name_keyword
| type_func_name_keyword
| reserved_keyword
;

Expand All @@ -2820,7 +2816,7 @@ identifier
| UnicodeQuotedIdentifier
| PLSQLVARIABLENAME
| PLSQLIDENTIFIER
| plsql_unreserved_keyword
| unreserved_keyword
;

unreserved_keyword
Expand Down Expand Up @@ -3125,6 +3121,39 @@ unreserved_keyword
| KW_YEAR
| KW_YES
| KW_ZONE
| KW_ALIAS
| KW_ASSERT
| KW_CONSTANT
| KW_DEBUG
| KW_DEFAULT
| KW_DIAGNOSTICS
| KW_DUMP
| KW_ELSIF
| KW_ERROR
| KW_EXCEPTION
| KW_EXIT
| KW_GET
| KW_INFO
| KW_IS
| KW_LOG
| KW_NOTICE
| KW_OPEN
| KW_PUBLIC
| KW_PERFORM
| KW_PRINT_STRICT_PARAMS
| KW_QUERY
| KW_RAISE
| KW_RETURN
| KW_REVERSE
| KW_ROWTYPE
| KW_SLICE
| KW_SQLSTATE
| KW_STACKED
| KW_USE_COLUMN
| KW_USE_VARIABLE
| KW_VARIABLE_CONFLICT
| KW_WARNING
| KW_OUTER
;

col_name_keyword
Expand Down Expand Up @@ -3600,73 +3629,7 @@ proc_condition

any_identifier
: colid
| plsql_unreserved_keyword
;

plsql_unreserved_keyword
: KW_ABSOLUTE
| KW_ALIAS
| KW_AND
| KW_ARRAY
| KW_ASSERT
| KW_BACKWARD
| KW_CALL
| KW_CHAIN
| KW_CLOSE
| KW_COLLATE
| KW_COMMIT
| KW_CONSTANT
| KW_CONSTRAINT
| KW_CONTINUE
| KW_CURRENT
| KW_CURSOR
| KW_DEBUG
| KW_DEFAULT
| KW_DIAGNOSTICS
| KW_DO
| KW_DUMP
| KW_ELSIF
| KW_ERROR
| KW_EXCEPTION
| KW_EXIT
| KW_FETCH
| KW_FIRST
| KW_FORWARD
| KW_GET
| KW_INFO
| KW_INSERT
| KW_IS
| KW_LAST
| KW_LOG
| KW_MOVE
| KW_NEXT
| KW_NO
| KW_NOTICE
| KW_OPEN
| KW_OPTION
| KW_PERFORM
| KW_PRINT_STRICT_PARAMS
| KW_PRIOR
| KW_QUERY
| KW_RAISE
| KW_RELATIVE
| KW_RESET
| KW_RETURN
| KW_REVERSE
| KW_ROLLBACK
| KW_ROWTYPE
| KW_SCHEMA
| KW_SCROLL
| KW_SET
| KW_SLICE
| KW_SQLSTATE
| KW_STACKED
| KW_TYPE
| KW_USE_COLUMN
| KW_USE_VARIABLE
| KW_VARIABLE_CONFLICT
| KW_WARNING
| KW_OUTER
| unreserved_keyword
;

sql_expression
Expand Down
3 changes: 1 addition & 2 deletions src/lib/postgresql/PostgreSqlParser.interp

Large diffs are not rendered by default.

Loading
Loading