Skip to content

Commit c998c09

Browse files
committed
Support row constructors
1 parent 95ea3b0 commit c998c09

File tree

5 files changed

+724914
-700144
lines changed

5 files changed

+724914
-700144
lines changed

grammar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,8 @@ module.exports = grammar({
12491249
array_element_access: $ =>
12501250
seq(choice($.identifier, $.argument_reference), "[", $._expression, "]"),
12511251

1252+
row_constructor: $ => seq(kw("ROW"), "(", commaSep($._expression), ")"),
1253+
12521254
unary_expression: $ =>
12531255
prec(
12541256
PREC.unary,
@@ -1321,6 +1323,7 @@ module.exports = grammar({
13211323
$.at_time_zone_expression,
13221324
$.rows_from_expression,
13231325
$.array_constructor,
1326+
$.row_constructor,
13241327
),
13251328
},
13261329
});

src/grammar.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11786,6 +11786,61 @@
1178611786
}
1178711787
]
1178811788
},
11789+
"row_constructor": {
11790+
"type": "SEQ",
11791+
"members": [
11792+
{
11793+
"type": "ALIAS",
11794+
"content": {
11795+
"type": "PATTERN",
11796+
"value": "[rR][oO][wW]"
11797+
},
11798+
"named": false,
11799+
"value": "ROW"
11800+
},
11801+
{
11802+
"type": "STRING",
11803+
"value": "("
11804+
},
11805+
{
11806+
"type": "CHOICE",
11807+
"members": [
11808+
{
11809+
"type": "SEQ",
11810+
"members": [
11811+
{
11812+
"type": "SYMBOL",
11813+
"name": "_expression"
11814+
},
11815+
{
11816+
"type": "REPEAT",
11817+
"content": {
11818+
"type": "SEQ",
11819+
"members": [
11820+
{
11821+
"type": "STRING",
11822+
"value": ","
11823+
},
11824+
{
11825+
"type": "SYMBOL",
11826+
"name": "_expression"
11827+
}
11828+
]
11829+
}
11830+
}
11831+
]
11832+
},
11833+
{
11834+
"type": "BLANK"
11835+
}
11836+
]
11837+
},
11838+
{
11839+
"type": "STRING",
11840+
"value": ")"
11841+
}
11842+
]
11843+
},
1178911844
"unary_expression": {
1179011845
"type": "PREC",
1179111846
"value": 7,
@@ -12239,6 +12294,10 @@
1223912294
{
1224012295
"type": "SYMBOL",
1224112296
"name": "array_constructor"
12297+
},
12298+
{
12299+
"type": "SYMBOL",
12300+
"name": "row_constructor"
1224212301
}
1224312302
]
1224412303
}

0 commit comments

Comments
 (0)