treesitter

This commit is contained in:
Christian De la Hoz 2021-09-01 17:48:58 +02:00
parent 2aba292171
commit f1278b0462
3 changed files with 71063 additions and 52198 deletions

View file

@ -65,6 +65,10 @@
"type": "SYMBOL",
"name": "delete_statement"
},
{
"type": "SYMBOL",
"name": "update_statement"
},
{
"type": "SYMBOL",
"name": "grant_statement"
@ -91,6 +95,175 @@
}
]
},
"update_statement": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "with_query"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][pP][dD][aA][tT][eE]"
},
"named": false,
"value": "update"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT]"
},
"named": false,
"value": "set"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "update_set"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "update_set"
}
]
}
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][rR][oO][mM]"
},
"named": false,
"value": "from"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "from_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "from_item"
}
]
}
}
]
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "where_filter"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "returning"
},
{
"type": "BLANK"
}
]
}
]
},
"drop_function_statement": {
"type": "SEQ",
"members": [
@ -420,6 +593,10 @@
{
"type": "SYMBOL",
"name": "delete_statement"
},
{
"type": "SYMBOL",
"name": "update_statement"
}
]
},
@ -505,7 +682,7 @@
"members": [
{
"type": "SYMBOL",
"name": "insert_returning"
"name": "returning"
},
{
"type": "BLANK"
@ -961,7 +1138,7 @@
}
]
},
"insert_returning": {
"returning": {
"type": "SEQ",
"members": [
{
@ -3285,7 +3462,12 @@
"type": "CHOICE",
"members": [
{
"type": "STRING",
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[pP][rR][iI][vV][iI][lL][eE][gG][eE][sS]"
},
"named": false,
"value": "privileges"
},
{
@ -4429,6 +4611,10 @@
"type": "SYMBOL",
"name": "assign_statement"
},
{
"type": "SYMBOL",
"name": "get_diagnostics_statement"
},
{
"type": "SYMBOL",
"name": "return_statement"
@ -4461,6 +4647,50 @@
}
]
},
"get_diagnostics_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[gG][eE][tT]"
},
"named": false,
"value": "get"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][uU][rR][rR][eE][nN][tT]"
},
"named": false,
"value": "current"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][iI][aA][gG][nN][oO][sS][tT][iI][cC][sS]"
},
"named": false,
"value": "diagnostics"
},
{
"type": "SYMBOL",
"name": "assign_statement"
}
]
},
"for_statement": {
"type": "SEQ",
"members": [
@ -4628,6 +4858,12 @@
"named": false,
"value": "raise"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
@ -4696,6 +4932,13 @@
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"if_statement": {
"type": "SEQ",
"members": [
@ -5264,6 +5507,18 @@
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
@ -6343,6 +6598,55 @@
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "function_run_as"
},
{
"type": "BLANK"
}
]
}
]
},
"function_run_as": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][cC][uU][rR][iI][tT][yY]"
},
"named": false,
"value": "security"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][vV][oO][kK][eE][rR]"
},
"named": false,
"value": "invoker"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][iI][nN][eE][rR]"
},
"named": false,
"value": "definer"
}
]
}
]
},
@ -7131,10 +7435,31 @@
"type": "STRING",
"value": "("
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
}
]
},
{
"type": "STRING",
"value": ")"
@ -7761,6 +8086,27 @@
]
}
},
{
"type": "PREC_LEFT",
"value": 5,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "SYMBOL",
"name": "contains_op"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 4,
@ -7948,6 +8294,47 @@
}
]
},
"contains_op": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][eE][tT][wW][eE][eE][nN]"
},
"named": false,
"value": "between"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN]"
},
"named": false,
"value": "in"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[lL][iI][kK][eE]"
},
"named": false,
"value": "like"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][lL][iI][kK][eE]"
},
"named": false,
"value": "ilike"
}
]
},
"comparison_null": {
"type": "CHOICE",
"members": [
@ -8138,7 +8525,7 @@
},
"number": {
"type": "PATTERN",
"value": "\\d+"
"value": "-?\\d+"
},
"identifier": {
"type": "SYMBOL",

View file

@ -449,6 +449,10 @@
"type": "for_statement",
"named": true
},
{
"type": "get_diagnostics_statement",
"named": true
},
{
"type": "grant_statement",
"named": true
@ -480,6 +484,10 @@
{
"type": "select_statement",
"named": true
},
{
"type": "update_statement",
"named": true
}
]
}
@ -668,6 +676,11 @@
"named": true,
"fields": {}
},
{
"type": "contains_op",
"named": true,
"fields": {}
},
{
"type": "create_function_statement",
"named": true,
@ -684,6 +697,10 @@
"type": "function_return",
"named": true
},
{
"type": "function_run_as",
"named": true
},
{
"type": "function_signature",
"named": true
@ -1293,6 +1310,10 @@
"type": "function_call",
"named": true
},
{
"type": "get_diagnostics_statement",
"named": true
},
{
"type": "grant_statement",
"named": true
@ -1356,6 +1377,10 @@
{
"type": "true",
"named": true
},
{
"type": "update_statement",
"named": true
}
]
}
@ -1515,6 +1540,10 @@
"type": ")",
"named": false
},
{
"type": ",",
"named": false
},
{
"type": ".",
"named": false
@ -1604,6 +1633,11 @@
]
}
},
{
"type": "function_run_as",
"named": true,
"fields": {}
},
{
"type": "function_signature",
"named": true,
@ -1628,6 +1662,21 @@
"named": true,
"fields": {}
},
{
"type": "get_diagnostics_statement",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "assign_statement",
"named": true
}
]
}
},
{
"type": "grant_function",
"named": true,
@ -1810,6 +1859,10 @@
"type": "function_call",
"named": true
},
{
"type": "get_diagnostics_statement",
"named": true
},
{
"type": "grant_statement",
"named": true
@ -1873,6 +1926,10 @@
{
"type": "true",
"named": true
},
{
"type": "update_statement",
"named": true
}
]
}
@ -2085,21 +2142,6 @@
]
}
},
{
"type": "insert_returning",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "select_item",
"named": true
}
]
}
},
{
"type": "insert_statement",
"named": true,
@ -2125,11 +2167,11 @@
"named": true
},
{
"type": "insert_returning",
"type": "into",
"named": true
},
{
"type": "into",
"type": "returning",
"named": true
},
{
@ -2284,6 +2326,10 @@
"type": "comparison_op",
"named": true
},
{
"type": "contains_op",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2509,7 +2555,7 @@
"fields": {},
"children": {
"multiple": true,
"required": true,
"required": false,
"types": [
{
"type": "dollar_quote_string",
@ -2655,6 +2701,21 @@
]
}
},
{
"type": "returning",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "select_item",
"named": true
}
]
}
},
{
"type": "schema_role",
"named": true,
@ -3223,6 +3284,10 @@
{
"type": "select_statement",
"named": true
},
{
"type": "update_statement",
"named": true
}
]
}
@ -3523,6 +3588,41 @@
]
}
},
{
"type": "update_statement",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "from_item",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "returning",
"named": true
},
{
"type": "update_set",
"named": true
},
{
"type": "where_filter",
"named": true
},
{
"type": "with_query",
"named": true
}
]
}
},
{
"type": "update_value",
"named": true,
@ -3788,6 +3888,10 @@
{
"type": "select_statement",
"named": true
},
{
"type": "update_statement",
"named": true
}
]
}
@ -3976,6 +4080,10 @@
"type": "begin",
"named": false
},
{
"type": "between",
"named": false
},
{
"type": "by",
"named": false
@ -4024,6 +4132,10 @@
"type": "cross",
"named": false
},
{
"type": "current",
"named": false
},
{
"type": "current_user",
"named": false
@ -4056,6 +4168,10 @@
"type": "deferred",
"named": false
},
{
"type": "definer",
"named": false
},
{
"type": "delete",
"named": false
@ -4064,6 +4180,10 @@
"type": "desc",
"named": false
},
{
"type": "diagnostics",
"named": false
},
{
"type": "do",
"named": false
@ -4136,6 +4256,10 @@
"type": "functions",
"named": false
},
{
"type": "get",
"named": false
},
{
"type": "grant",
"named": false
@ -4156,6 +4280,10 @@
"type": "if",
"named": false
},
{
"type": "ilike",
"named": false
},
{
"type": "immediate",
"named": false
@ -4204,6 +4332,10 @@
"type": "into",
"named": false
},
{
"type": "invoker",
"named": false
},
{
"type": "is",
"named": false
@ -4248,6 +4380,10 @@
"type": "left",
"named": false
},
{
"type": "like",
"named": false
},
{
"type": "limit",
"named": false
@ -4424,6 +4560,10 @@
"type": "second",
"named": false
},
{
"type": "security",
"named": false
},
{
"type": "select",
"named": false

122618
src/parser.c

File diff suppressed because it is too large Load diff