treesitter

This commit is contained in:
Christian De la Hoz 2021-09-02 20:45:29 +02:00
parent 931b7ab582
commit c266746eaa
3 changed files with 74354 additions and 61749 deletions

View file

@ -41,6 +41,10 @@
"type": "SYMBOL",
"name": "drop_function_statement"
},
{
"type": "SYMBOL",
"name": "drop_type_statement"
},
{
"type": "SYMBOL",
"name": "create_table_statement"
@ -95,6 +99,97 @@
}
]
},
"drop_type_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][rR][oO][pP]"
},
"named": false,
"value": "drop"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][yY][pP][eE]"
},
"named": false,
"value": "type"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][aA][sS][cC][aA][dD][eE]"
},
"named": false,
"value": "cascade"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][sS][tT][rR][iI][cC][tT]"
},
"named": false,
"value": "restrict"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"update_statement": {
"type": "SEQ",
"members": [
@ -787,6 +882,23 @@
{
"type": "SYMBOL",
"name": "select_statement"
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "select_statement"
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
@ -4615,6 +4727,10 @@
"type": "SYMBOL",
"name": "get_diagnostics_statement"
},
{
"type": "SYMBOL",
"name": "open_cursor_statement"
},
{
"type": "SYMBOL",
"name": "return_statement"
@ -4647,6 +4763,46 @@
}
]
},
"open_cursor_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][pP][eE][nN]"
},
"named": false,
"value": "open"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][oO][rR]"
},
"named": false,
"value": "for"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "select_statement"
},
{
"type": "SYMBOL",
"name": "execute_statement"
}
]
}
]
},
"get_diagnostics_statement": {
"type": "SEQ",
"members": [
@ -6667,7 +6823,7 @@
"members": [
{
"type": "SYMBOL",
"name": "identifier"
"name": "_type"
},
{
"type": "SYMBOL",
@ -6695,7 +6851,7 @@
},
{
"type": "SYMBOL",
"name": "identifier"
"name": "_type"
}
]
},
@ -7470,6 +7626,10 @@
"type": "SYMBOL",
"name": "function_call"
},
{
"type": "SYMBOL",
"name": "array_constructor"
},
{
"type": "SYMBOL",
"name": "op_expression"
@ -7501,6 +7661,61 @@
}
]
},
"array_constructor": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][rR][rR][aA][yY]"
},
"named": false,
"value": "array"
},
{
"type": "STRING",
"value": "["
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "]"
}
]
},
"dollar_quote_string": {
"type": "SEQ",
"members": [
@ -7518,7 +7733,7 @@
},
{
"type": "PATTERN",
"value": "(([^$]+)|(%\\d+\\$s)|(\\$\\d+))+"
"value": "(([^$]+)|(%\\d+\\$[sI])|(\\$\\d+))+"
},
{
"type": "STRING",
@ -7970,7 +8185,7 @@
},
{
"type": "SYMBOL",
"name": "identifier"
"name": "_type"
}
]
}

View file

@ -11,6 +11,10 @@
"type": "alter_column_type",
"named": true
},
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -70,6 +74,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -288,6 +296,69 @@
"named": true,
"fields": {}
},
{
"type": "array_constructor",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
},
{
"type": "false",
"named": true
},
{
"type": "function_call",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "null",
"named": true
},
{
"type": "number",
"named": true
},
{
"type": "op_expression",
"named": true
},
{
"type": "select_statement",
"named": true
},
{
"type": "star",
"named": true
},
{
"type": "string",
"named": true
},
{
"type": "time_expression",
"named": true
},
{
"type": "true",
"named": true
}
]
}
},
{
"type": "as",
"named": true,
@ -311,6 +382,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -441,6 +516,10 @@
"type": "drop_function_statement",
"named": true
},
{
"type": "drop_type_statement",
"named": true
},
{
"type": "execute_statement",
"named": true
@ -465,6 +544,10 @@
"type": "insert_statement",
"named": true
},
{
"type": "open_cursor_statement",
"named": true
},
{
"type": "perform_statement",
"named": true
@ -523,6 +606,10 @@
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "constraint_foreign_key",
"named": true
@ -601,6 +688,10 @@
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -1083,6 +1174,25 @@
]
}
},
{
"type": "drop_type_statement",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "identifier",
"named": true
},
{
"type": "if_exists",
"named": true
}
]
}
},
{
"type": "execute_statement",
"named": true,
@ -1091,6 +1201,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -1158,6 +1272,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -1246,6 +1364,10 @@
"type": "alter_table_statement",
"named": true
},
{
"type": "array_constructor",
"named": true
},
{
"type": "assign_statement",
"named": true
@ -1294,6 +1416,10 @@
"type": "drop_function_statement",
"named": true
},
{
"type": "drop_type_statement",
"named": true
},
{
"type": "execute_statement",
"named": true
@ -1342,6 +1468,10 @@
"type": "op_expression",
"named": true
},
{
"type": "open_cursor_statement",
"named": true
},
{
"type": "perform_statement",
"named": true
@ -1473,6 +1603,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -1548,6 +1682,10 @@
"type": ".",
"named": false
},
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -1622,6 +1760,10 @@
"type": "identifier",
"named": true
},
{
"type": "predefined_types",
"named": true
},
{
"type": "return_setof",
"named": true
@ -1795,6 +1937,10 @@
"type": "alter_table_statement",
"named": true
},
{
"type": "array_constructor",
"named": true
},
{
"type": "assign_statement",
"named": true
@ -1843,6 +1989,10 @@
"type": "drop_function_statement",
"named": true
},
{
"type": "drop_type_statement",
"named": true
},
{
"type": "execute_statement",
"named": true
@ -1891,6 +2041,10 @@
"type": "op_expression",
"named": true
},
{
"type": "open_cursor_statement",
"named": true
},
{
"type": "perform_statement",
"named": true
@ -1942,6 +2096,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2072,6 +2230,10 @@
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2204,6 +2366,10 @@
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2310,6 +2476,10 @@
"type": "and",
"named": true
},
{
"type": "array_constructor",
"named": true
},
{
"type": "cast",
"named": true
@ -2378,6 +2548,10 @@
"type": "plus",
"named": true
},
{
"type": "predefined_types",
"named": true
},
{
"type": "select_statement",
"named": true
@ -2401,6 +2575,29 @@
]
}
},
{
"type": "open_cursor_statement",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "execute_statement",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "select_statement",
"named": true
}
]
}
},
{
"type": "or",
"named": true,
@ -2424,6 +2621,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2557,6 +2758,10 @@
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2619,6 +2824,10 @@
{
"type": "identifier",
"named": true
},
{
"type": "predefined_types",
"named": true
}
]
}
@ -2631,6 +2840,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2754,6 +2967,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2813,6 +3030,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2872,6 +3093,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2931,6 +3156,10 @@
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -2990,6 +3219,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -3269,6 +3502,10 @@
"type": "drop_function_statement",
"named": true
},
{
"type": "drop_type_statement",
"named": true
},
{
"type": "grant_statement",
"named": true
@ -3356,6 +3593,10 @@
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "constraint_foreign_key",
"named": true
@ -3424,6 +3665,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -3483,6 +3728,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -3631,6 +3880,10 @@
"multiple": true,
"required": false,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -3736,6 +3989,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -3799,6 +4056,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "array_constructor",
"named": true
},
{
"type": "dollar_quote_string",
"named": true
@ -4056,6 +4317,10 @@
"type": "and",
"named": false
},
{
"type": "array",
"named": false
},
{
"type": "as",
"named": false
@ -4460,6 +4725,10 @@
"type": "on",
"named": false
},
{
"type": "open",
"named": false
},
{
"type": "or",
"named": false

135611
src/parser.c

File diff suppressed because it is too large Load diff