Skip to content

Commit

Permalink
fix: Remove identifier alias from cast builtin function
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoniePhiline committed Feb 18, 2023
1 parent f0a4dc2 commit 44ffd90
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ module.exports = grammar({
),

cast: $ => seq(
field('name', alias($.keyword_cast, $.identifier)),
field('name', $.keyword_cast),
'(',
seq(
field('parameter', $._expression),
Expand Down
9 changes: 2 additions & 7 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/parser.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions test/corpus/casting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SELECT CAST(1 AS TEXT);
(select_expression
(term
(cast
(identifier)
(keyword_cast)
(literal)
(keyword_as)
(keyword_text)))))))
Expand All @@ -33,7 +33,7 @@ SELECT CAST(1 AS TEXT) AS fieldname;
(select_expression
(term
value: (cast
name: (identifier)
name: (keyword_cast)
parameter: (literal)
(keyword_as)
(keyword_text))
Expand Down Expand Up @@ -83,7 +83,7 @@ SELECT
(select_expression
(term
value: (cast
name: (identifier)
name: (keyword_cast)
parameter: (literal)
(keyword_as)
(int
Expand Down Expand Up @@ -116,7 +116,7 @@ CAST (100 AS NUMERIC(32)),
(select_expression
(term
value: (cast
name: (identifier)
name: (keyword_cast)
parameter: (literal)
(keyword_as)
(numeric
Expand Down Expand Up @@ -148,7 +148,7 @@ SELECT CAST ("1" AS UNSIGNED INTEGER);
(select_expression
(term
value: (cast
name: (identifier)
name: (keyword_cast)
parameter: (literal)
(keyword_as)
(int
Expand All @@ -174,7 +174,7 @@ SELECT '1 day 10 seconds'::INTERVAL, CAST('1 month' AS INTERVAL)
(keyword_interval)))
(term
value: (cast
name: (identifier)
name: (keyword_cast)
parameter: (literal)
(keyword_as)
(keyword_interval)))))))
4 changes: 2 additions & 2 deletions test/corpus/window_functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ FROM
(keyword_false))
(keyword_end))
(cast
(identifier)
(keyword_cast)
(field
(identifier))
(keyword_as)
Expand Down Expand Up @@ -622,7 +622,7 @@ FROM
(keyword_end)))
(order_target
(cast
(identifier)
(keyword_cast)
(field
(identifier))
(keyword_as)
Expand Down

0 comments on commit 44ffd90

Please sign in to comment.