grammar: improve table constraint
This commit is contained in:
parent
6e78cac399
commit
dc0ff18f18
2 changed files with 21 additions and 38 deletions
12
grammar.js
12
grammar.js
|
@ -329,14 +329,10 @@ module.exports = grammar({
|
|||
),
|
||||
|
||||
table_constraint: ($) =>
|
||||
choice(
|
||||
seq($.table_constraint_ty, optional($.constraint_when)),
|
||||
seq(
|
||||
kw("constraint"),
|
||||
$.identifier,
|
||||
$.table_constraint_ty,
|
||||
optional($.constraint_when)
|
||||
)
|
||||
seq(
|
||||
optional(seq(kw("constraint"), $.identifier)),
|
||||
$.table_constraint_ty,
|
||||
optional($.constraint_when)
|
||||
),
|
||||
|
||||
constraint_when: ($) =>
|
||||
|
|
|
@ -2144,55 +2144,42 @@
|
|||
]
|
||||
},
|
||||
"table_constraint": {
|
||||
"type": "CHOICE",
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "table_constraint_ty"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "constraint_when"
|
||||
"type": "PATTERN",
|
||||
"value": "[cC][oO][nN][sS][tT][rR][aA][iI][nN][tT]"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
"type": "SYMBOL",
|
||||
"name": "table_constraint_ty"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "PATTERN",
|
||||
"value": "[cC][oO][nN][sS][tT][rR][aA][iI][nN][tT]"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
"name": "constraint_when"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "table_constraint_ty"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "constraint_when"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue