on master help sign in
Update SQL grammar (#4529)
f671087seshotake
languages.toml+1−1
@@ -1371,7 +1371,7 @@ injection-regex = "sql"
1371
1371
1372[[grammar]]
1372[[grammar]]
1373name = "sql"
1373name = "sql"
1374−source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "0caa7fa2ee00e0b770493a79d4efacc1fc376cc5" }
1374+source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "2743c7b5e710e6854d4e8c14c302548b436e2a1f" }
1375
1375
1376[[language]]
1376[[language]]
1377name = "gdscript"
1377name = "gdscript"
runtime/queries/sql/highlights.scm+45−7
@@ -1,3 +1,34 @@
1+(keyword_gist) @function.builtin
2+(keyword_btree) @function.builtin
3+(keyword_btree) @function.builtin
4+(keyword_hash) @function.builtin
5+(keyword_spgist) @function.builtin
6+(keyword_gin) @function.builtin
7+(keyword_brin) @function.builtin
8+(keyword_float) @function.builtin
9+
10+(invocation
11+ name: (identifier) @function.builtin
12+ parameter: [(field)]? @variable.other.member)
13+
14+(count
15+ name: (identifier) @function.builtin
16+ parameter: [(field)]? @variable.other.member)
17+
18+(table_reference
19+ name: (identifier) @namespace)
20+
21+(relation
22+ table_alias: (identifier) @variable.parameter)
23+
24+(field
25+ name: (identifier) @variable.other.member)
26+
27+(field
28+ table_alias: (identifier) @variable.parameter
29+ name: (identifier) @variable.other.member)
30+
31+
1(comment) @comment
32(comment) @comment
2
33
3[
34[
@@ -5,6 +36,12 @@
5 ")"
36 ")"
6] @punctuation.bracket
37] @punctuation.bracket
7
38
39+[
40+ ";"
41+ ","
42+ "."
43+] @punctuation.delimiter
44+
8[
45[
9 "*"
46 "*"
10 "+"
47 "+"
@@ -29,11 +66,8 @@
29
66
30(literal) @string
67(literal) @string
31
68
32−(set_schema schema: (identifier) @namespace)
69+((literal) @constant.numeric
33−(table_reference schema: (identifier) @namespace)
70+ (#match? @constant.numeric "^(-?\d*\.?\d*)$"))
34−(table_expression schema: (identifier) @namespace)
35−(all_fields schema: (identifier) @namespace)
36−(field schema: (identifier) @namespace)
37
71
38[
72[
39 (keyword_select)
73 (keyword_select)
@@ -54,8 +88,10 @@
54 (keyword_lateral)
88 (keyword_lateral)
55 (keyword_on)
89 (keyword_on)
56 (keyword_not)
90 (keyword_not)
57− (keyword_order_by)
91+ (keyword_order)
58− (keyword_group_by)
92+ (keyword_group)
93+ (keyword_partition)
94+ (keyword_by)
59 (keyword_having)
95 (keyword_having)
60 (keyword_desc)
96 (keyword_desc)
61 (keyword_asc)
97 (keyword_asc)
@@ -89,6 +125,8 @@
89 (keyword_auto_increment)
125 (keyword_auto_increment)
90 (keyword_default)
126 (keyword_default)
91 (keyword_cascade)
127 (keyword_cascade)
128+ (keyword_between)
129+ (keyword_window)
92 (keyword_with)
130 (keyword_with)
93 (keyword_no)
131 (keyword_no)
94 (keyword_data)
132 (keyword_data)