Skip to content

Commit

Permalink
parser: parse qualified_name for table name
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbz64 committed Jan 8, 2024
1 parent 5116673 commit ae183cd
Show file tree
Hide file tree
Showing 4 changed files with 47,757 additions and 46,169 deletions.
8 changes: 4 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ module.exports = grammar({
field("name", $.identifier),
kw("FOR"),
optional(kw("TEMP-TABLE")),
field("table", $.identifier),
field("table", choice($.identifier, $.qualified_name)),
$._terminator
),

Expand Down Expand Up @@ -700,7 +700,7 @@ module.exports = grammar({
optional($.label),
kw("FOR"),
field("type", choice(kw("EACH"), kw("FIRST"), kw("LAST"))),
field("table", $.identifier),
field("table", choice($.identifier, $.qualified_name)),
optional($.of),
optional($._pre_tuning),
optional($.where_clause),
Expand All @@ -722,7 +722,7 @@ module.exports = grammar({
seq(
kw("FIND"),
field("type", optional($._find_type)),
field("table", $.identifier),
field("table", choice($.identifier, $.qualified_name)),
optional($.of),
optional($._pre_tuning),
optional($.where_clause),
Expand All @@ -735,7 +735,7 @@ module.exports = grammar({
kw("CAN-FIND"),
"(",
optional(choice(kw("FIRST"), kw("LAST"))),
field("table", $.identifier),
field("table", choice($.identifier, $.qualified_name)),
optional(field("constant", $._expression)),
repeat(
choice(
Expand Down
52 changes: 44 additions & 8 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1859,8 +1859,17 @@
"type": "FIELD",
"name": "table",
"content": {
"type": "SYMBOL",
"name": "identifier"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "qualified_name"
}
]
}
},
{
Expand Down Expand Up @@ -5555,8 +5564,17 @@
"type": "FIELD",
"name": "table",
"content": {
"type": "SYMBOL",
"name": "identifier"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "qualified_name"
}
]
}
},
{
Expand Down Expand Up @@ -5796,8 +5814,17 @@
"type": "FIELD",
"name": "table",
"content": {
"type": "SYMBOL",
"name": "identifier"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "qualified_name"
}
]
}
},
{
Expand Down Expand Up @@ -5921,8 +5948,17 @@
"type": "FIELD",
"name": "table",
"content": {
"type": "SYMBOL",
"name": "identifier"
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "qualified_name"
}
]
}
},
{
Expand Down
16 changes: 16 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@
{
"type": "identifier",
"named": true
},
{
"type": "qualified_name",
"named": true
}
]
}
Expand All @@ -460,6 +464,10 @@
{
"type": "identifier",
"named": true
},
{
"type": "qualified_name",
"named": true
}
]
}
Expand Down Expand Up @@ -1013,6 +1021,10 @@
{
"type": "identifier",
"named": true
},
{
"type": "qualified_name",
"named": true
}
]
},
Expand Down Expand Up @@ -1073,6 +1085,10 @@
{
"type": "identifier",
"named": true
},
{
"type": "qualified_name",
"named": true
}
]
},
Expand Down
Loading

0 comments on commit ae183cd

Please sign in to comment.