more noise

This commit is contained in:
Christian De la Hoz 2021-08-31 20:33:46 +02:00
parent f13c6b4712
commit 3d27025598
5 changed files with 54400 additions and 41327 deletions

View file

@ -1,13 +1,12 @@
.DEFAULT_GOAL := build .DEFAULT_GOAL := g
.PHONY: build test bless .PHONY: g t b
build: g:
tree-sitter generate tree-sitter generate
test: t:
@$(MAKE) --no-print-directory build # @$(MAKE) --no-print-directory build
tree-sitter test tree-sitter test
bless: b:
@$(MAKE) --no-print-directory build
tree-sitter test --update tree-sitter test --update

View file

@ -1,13 +1,10 @@
let let
pkgs = import <nixpkgs> { }; pkgs = import <nixpkgs> { };
# openssl = pkgs.openssl.override { static = true; };
in pkgs.mkShell { in pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
git
nodejs nodejs
gcc gcc
tree-sitter tree-sitter
]; ];
# buildInputs = with pkgs; [ openssl pkg-config lld ];
# LD_LIBRARY_PATH="${pkgs.openssl.out}/lib";
# LD_LIBRARY_PATH = "${openssl}/lib";
} }

View file

@ -37,6 +37,10 @@
"type": "SYMBOL", "type": "SYMBOL",
"name": "create_function_statement" "name": "create_function_statement"
}, },
{
"type": "SYMBOL",
"name": "drop_function_statement"
},
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "create_table_statement" "name": "create_table_statement"
@ -87,6 +91,178 @@
} }
] ]
}, },
"drop_function_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][rR][oO][pP]"
},
"named": false,
"value": "drop"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][uU][nN][cC][tT][iI][oO][nN]"
},
"named": false,
"value": "function"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "drop_function_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "drop_function_item"
}
]
}
}
]
},
{
"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"
}
]
}
]
},
"drop_function_item": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "var_declaration"
},
{
"type": "SYMBOL",
"name": "_type"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "var_declaration"
},
{
"type": "SYMBOL",
"name": "_type"
}
]
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"create_type_statement": { "create_type_statement": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
@ -4741,8 +4917,17 @@
"name": "identifier" "name": "identifier"
}, },
{ {
"type": "STRING", "type": "CHOICE",
"value": "=" "members": [
{
"type": "STRING",
"value": "="
},
{
"type": "STRING",
"value": ":="
}
]
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
@ -5350,52 +5535,99 @@
] ]
}, },
"select_group_by": { "select_group_by": {
"type": "SEQ", "type": "PREC",
"members": [ "value": 1,
{ "content": {
"type": "ALIAS", "type": "SEQ",
"content": { "members": [
"type": "PATTERN", {
"value": "[gG][rR][oO][uU][pP]" "type": "ALIAS",
}, "content": {
"named": false, "type": "PATTERN",
"value": "group" "value": "[gG][rR][oO][uU][pP]"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][yY]"
},
"named": false,
"value": "by"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
}, },
{ "named": false,
"type": "REPEAT", "value": "group"
"content": { },
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][yY]"
},
"named": false,
"value": "by"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
{ {
"type": "STRING", "type": "STRING",
"value": "," "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": ")"
}
]
},
{
"type": "SEQ",
"members": [
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "_value_expression" "name": "_value_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
} }
] ]
} }
} ]
] }
} ]
] }
}, },
"select_order_by": { "select_order_by": {
"type": "SEQ", "type": "SEQ",
@ -7019,6 +7251,319 @@
"name": "_value_expression" "name": "_value_expression"
} }
] ]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][tT][eE][rR][vV][aA][lL]"
},
"named": false,
"value": "interval"
},
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_interval_fields"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
"_interval_fields": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[yY][eE][aA][rR]"
},
"named": false,
"value": "year"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][oO][nN][tT][hH]"
},
"named": false,
"value": "month"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][aA][yY]"
},
"named": false,
"value": "day"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[hH][oO][uU][rR]"
},
"named": false,
"value": "hour"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][iI][nN][uU][tT][eE]"
},
"named": false,
"value": "minute"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][cC][oO][nN][dD]"
},
"named": false,
"value": "second"
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[yY][eE][aA][rR]"
},
"named": false,
"value": "year"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][oO][nN][tT][hH]"
},
"named": false,
"value": "month"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][aA][yY]"
},
"named": false,
"value": "day"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[hH][oO][uU][rR]"
},
"named": false,
"value": "hour"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][aA][yY]"
},
"named": false,
"value": "day"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][iI][nN][uU][tT][eE]"
},
"named": false,
"value": "minute"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][aA][yY]"
},
"named": false,
"value": "day"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][cC][oO][nN][dD]"
},
"named": false,
"value": "second"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[hH][oO][uU][rR]"
},
"named": false,
"value": "hour"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][iI][nN][uU][tT][eE]"
},
"named": false,
"value": "minute"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[hH][oO][uU][rR]"
},
"named": false,
"value": "hour"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][cC][oO][nN][dD]"
},
"named": false,
"value": "second"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][iI][nN][uU][tT][eE]"
},
"named": false,
"value": "minute"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][cC][oO][nN][dD]"
},
"named": false,
"value": "second"
}
]
} }
] ]
}, },
@ -7100,7 +7645,7 @@
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "_value_expression" "name": "identifier"
} }
] ]
} }
@ -7237,6 +7782,44 @@
] ]
} }
}, },
{
"type": "PREC_LEFT",
"value": 3,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "SYMBOL",
"name": "comparison_kw"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 3,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "SYMBOL",
"name": "comparison_null"
}
]
}
},
{ {
"type": "PREC_RIGHT", "type": "PREC_RIGHT",
"value": 2, "value": 2,
@ -7365,12 +7948,117 @@
} }
] ]
}, },
"comparison_null": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][sS][ ][nN][uU][lL][lL]"
},
"named": false,
"value": "is null"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][sS][nN][uU][lL][lL]"
},
"named": false,
"value": "isnull"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][sS][ ][nN][oO][tT][ ][nN][uU][lL][lL]"
},
"named": false,
"value": "is not null"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][tT][nN][uU][lL][lL]"
},
"named": false,
"value": "notnull"
}
]
},
"comparison_kw": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][sS]"
},
"named": false,
"value": "is"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][sS][ ][dD][iI][sS][tT][iI][nN][cC][tT][ ][fF][rR][oO][mM]"
},
"named": false,
"value": "is distinct from"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][sS][ ][nN][oO][tT][ ][dD][iI][sS][tT][iI][nN][cC][tT][ ][fF][rR][oO][mM]"
},
"named": false,
"value": "is not distinct from"
}
]
},
"other_op": { "other_op": {
"type": "CHOICE", "type": "CHOICE",
"members": [ "members": [
{ {
"type": "STRING", "type": "STRING",
"value": "||" "value": "||"
},
{
"type": "STRING",
"value": "<@"
},
{
"type": "STRING",
"value": "@>"
},
{
"type": "STRING",
"value": "<<"
},
{
"type": "STRING",
"value": ">>"
},
{
"type": "STRING",
"value": "&&"
},
{
"type": "STRING",
"value": "&<"
},
{
"type": "STRING",
"value": "&>"
},
{
"type": "STRING",
"value": "-|-"
} }
] ]
}, },

View file

@ -437,6 +437,10 @@
"type": "do_block", "type": "do_block",
"named": true "named": true
}, },
{
"type": "drop_function_statement",
"named": true
},
{ {
"type": "execute_statement", "type": "execute_statement",
"named": true "named": true
@ -566,6 +570,16 @@
] ]
} }
}, },
{
"type": "comparison_kw",
"named": true,
"fields": {}
},
{
"type": "comparison_null",
"named": true,
"fields": {}
},
{ {
"type": "comparison_op", "type": "comparison_op",
"named": true, "named": true,
@ -1010,6 +1024,48 @@
"named": true, "named": true,
"fields": {} "fields": {}
}, },
{
"type": "drop_function_item",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "identifier",
"named": true
},
{
"type": "if_exists",
"named": true
},
{
"type": "predefined_types",
"named": true
},
{
"type": "var_declaration",
"named": true
}
]
}
},
{
"type": "drop_function_statement",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "drop_function_item",
"named": true
}
]
}
},
{ {
"type": "execute_statement", "type": "execute_statement",
"named": true, "named": true,
@ -1217,6 +1273,10 @@
"type": "dollar_quote_string", "type": "dollar_quote_string",
"named": true "named": true
}, },
{
"type": "drop_function_statement",
"named": true
},
{ {
"type": "execute_statement", "type": "execute_statement",
"named": true "named": true
@ -1730,6 +1790,10 @@
"type": "dollar_quote_string", "type": "dollar_quote_string",
"named": true "named": true
}, },
{
"type": "drop_function_statement",
"named": true
},
{ {
"type": "execute_statement", "type": "execute_statement",
"named": true "named": true
@ -2208,6 +2272,14 @@
"type": "cast", "type": "cast",
"named": true "named": true
}, },
{
"type": "comparison_kw",
"named": true
},
{
"type": "comparison_null",
"named": true
},
{ {
"type": "comparison_op", "type": "comparison_op",
"named": true "named": true
@ -3132,6 +3204,10 @@
"type": "do_block", "type": "do_block",
"named": true "named": true
}, },
{
"type": "drop_function_statement",
"named": true
},
{ {
"type": "grant_statement", "type": "grant_statement",
"named": true "named": true
@ -3736,6 +3812,18 @@
"type": "%type", "type": "%type",
"named": false "named": false
}, },
{
"type": "&&",
"named": false
},
{
"type": "&<",
"named": false
},
{
"type": "&>",
"named": false
},
{ {
"type": "'", "type": "'",
"named": false "named": false
@ -3764,6 +3852,10 @@
"type": "-", "type": "-",
"named": false "named": false
}, },
{
"type": "-|-",
"named": false
},
{ {
"type": ".", "type": ".",
"named": false "named": false
@ -3788,6 +3880,10 @@
"type": "<", "type": "<",
"named": false "named": false
}, },
{
"type": "<<",
"named": false
},
{ {
"type": "<=", "type": "<=",
"named": false "named": false
@ -3796,6 +3892,10 @@
"type": "<>", "type": "<>",
"named": false "named": false
}, },
{
"type": "<@",
"named": false
},
{ {
"type": "=", "type": "=",
"named": false "named": false
@ -3808,6 +3908,14 @@
"type": ">=", "type": ">=",
"named": false "named": false
}, },
{
"type": ">>",
"named": false
},
{
"type": "@>",
"named": false
},
{ {
"type": "[", "type": "[",
"named": false "named": false
@ -3928,6 +4036,10 @@
"type": "data", "type": "data",
"named": false "named": false
}, },
{
"type": "day",
"named": false
},
{ {
"type": "declare", "type": "declare",
"named": false "named": false
@ -4036,6 +4148,10 @@
"type": "having", "type": "having",
"named": false "named": false
}, },
{
"type": "hour",
"named": false
},
{ {
"type": "if", "type": "if",
"named": false "named": false
@ -4080,10 +4196,38 @@
"type": "instead of", "type": "instead of",
"named": false "named": false
}, },
{
"type": "interval",
"named": false
},
{ {
"type": "into", "type": "into",
"named": false "named": false
}, },
{
"type": "is",
"named": false
},
{
"type": "is distinct from",
"named": false
},
{
"type": "is not distinct from",
"named": false
},
{
"type": "is not null",
"named": false
},
{
"type": "is null",
"named": false
},
{
"type": "isnull",
"named": false
},
{ {
"type": "join", "type": "join",
"named": false "named": false
@ -4120,10 +4264,18 @@
"type": "maxvalue", "type": "maxvalue",
"named": false "named": false
}, },
{
"type": "minute",
"named": false
},
{ {
"type": "minvalue", "type": "minvalue",
"named": false "named": false
}, },
{
"type": "month",
"named": false
},
{ {
"type": "natural", "type": "natural",
"named": false "named": false
@ -4144,6 +4296,10 @@
"type": "nothing", "type": "nothing",
"named": false "named": false
}, },
{
"type": "notnull",
"named": false
},
{ {
"type": "null", "type": "null",
"named": false "named": false
@ -4264,6 +4420,10 @@
"type": "schema", "type": "schema",
"named": false "named": false
}, },
{
"type": "second",
"named": false
},
{ {
"type": "select", "type": "select",
"named": false "named": false
@ -4384,6 +4544,10 @@
"type": "with", "type": "with",
"named": false "named": false
}, },
{
"type": "year",
"named": false
},
{ {
"type": "zone", "type": "zone",
"named": false "named": false

94783
src/parser.c

File diff suppressed because it is too large Load diff