grammar: improve table constraint

This commit is contained in:
Dmitriy Pleshevskiy 2023-01-06 00:54:05 +03:00
parent 6e78cac399
commit dc0ff18f18
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
2 changed files with 21 additions and 38 deletions

View File

@ -329,14 +329,10 @@ module.exports = grammar({
),
table_constraint: ($) =>
choice(
seq($.table_constraint_ty, optional($.constraint_when)),
seq(
kw("constraint"),
$.identifier,
optional(seq(kw("constraint"), $.identifier)),
$.table_constraint_ty,
optional($.constraint_when)
)
),
constraint_when: ($) =>

View File

@ -2144,29 +2144,11 @@
]
},
"table_constraint": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "table_constraint_ty"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "constraint_when"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
@ -2177,6 +2159,13 @@
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
@ -2195,8 +2184,6 @@
]
}
]
}
]
},
"constraint_when": {
"type": "CHOICE",