Skip to content

Commit dc47661

Browse files
kkk
1 parent 39b2dde commit dc47661

2 files changed

Lines changed: 29 additions & 28 deletions

File tree

crates/pgls_treesitter_grammar/grammar.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,33 +2618,33 @@ module.exports = grammar({
26182618
partialSeq(
26192619
field("left", $.lhs_column_list),
26202620
"=",
2621-
field(
2622-
"end",
2623-
choice(
2624-
wrapped_in_parenthesis(
2625-
comma_list(
2626-
choice($._expression, $.all_fields, $.keyword_default),
2627-
true,
2628-
),
2629-
),
2630-
partialSeq(
2631-
$.keyword_row,
2632-
wrapped_in_parenthesis(
2633-
comma_list(
2634-
choice($._expression, $.all_fields, $.keyword_default),
2635-
false,
2636-
),
2637-
),
2638-
),
2639-
$.subquery,
2640-
),
2641-
),
2621+
field("end", $.rhs_column_list),
26422622
),
26432623
),
26442624

26452625
lhs_column_list: ($) =>
26462626
partialSeq("(", comma_list($._column_indirection, false), ")"),
26472627

2628+
rhs_column_list: ($) =>
2629+
choice(
2630+
wrapped_in_parenthesis(
2631+
comma_list(
2632+
choice($._expression, $.all_fields, $.keyword_default),
2633+
true,
2634+
),
2635+
),
2636+
partialSeq(
2637+
$.keyword_row,
2638+
wrapped_in_parenthesis(
2639+
comma_list(
2640+
choice($._expression, $.all_fields, $.keyword_default),
2641+
false,
2642+
),
2643+
),
2644+
),
2645+
$.subquery,
2646+
),
2647+
26482648
table_option: ($) =>
26492649
choice(
26502650
seq(

crates/pgls_treesitter_grammar/tests/snapshots/grammar_tests__test_2_sql3.snap

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ program [0..55] 'update auth.users set (email, id) = ('my@mail.com', 1);'
1818
assignment [22..54] '(email, id) = ('my@mail.com', 1)' (@end)
1919
lhs_column_list [22..33] '(email, id)' (@left)
2020
( [22..23] '('
21-
column_identifier [23..28] 'email' (@end)
21+
column_identifier [23..28] 'email'
2222
, [28..29] ','
23-
column_identifier [30..32] 'id' (@end)
23+
column_identifier [30..32] 'id'
2424
) [32..33] ')'
2525
= [34..35] '='
26-
( [36..37] '(' (@right)
27-
literal [37..50] ''my@mail.com'' (@right)
28-
, [50..51] ',' (@right)
29-
literal [52..53] '1' (@right)
30-
) [53..54] ')' (@end)
26+
rhs_column_list [36..54] '('my@mail.com', 1)' (@end)
27+
( [36..37] '('
28+
literal [37..50] ''my@mail.com''
29+
, [50..51] ','
30+
literal [52..53] '1'
31+
) [53..54] ')' (@end)
3132
; [54..55] ';'

0 commit comments

Comments
 (0)