@willbooster/tree-sitter-sql 4.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -29
- package/common/common.mjs +2 -9
- package/mysql/src/node-types.json +5361 -19850
- package/oracle/src/node-types.json +8786 -48891
- package/package.json +6 -7
- package/postgresql/src/node-types.json +8543 -23838
- package/sqlite/grammar.js +6 -5
- package/tree-sitter-mysql.wasm +0 -0
- package/tree-sitter-oracle.wasm +0 -0
- package/tree-sitter-postgresql.wasm +0 -0
- package/tree-sitter-sqlite.wasm +0 -0
- package/tree-sitter.json +1 -1
package/sqlite/grammar.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// and its tokenizer, src/tokenize.c, and also reject what SQLite rejects while parsing, beyond those two files (e.g. an
|
|
8
8
|
// unknown join type, or ORDER BY on a SELECT before UNION).
|
|
9
9
|
|
|
10
|
-
import { commaSep, commaSep1, keyword,
|
|
10
|
+
import { commaSep, commaSep1, keyword, keywords } from '../common/common.mjs';
|
|
11
11
|
|
|
12
12
|
// The CLI injects the DSL before loading this grammar.
|
|
13
13
|
const { grammar, alias, choice, field, optional, prec, repeat, repeat1, reserved, seq, token } =
|
|
@@ -154,6 +154,7 @@ const triggerInsert = ($, head) =>
|
|
|
154
154
|
const triggerDelete = ($, target) => seq(keywords('DELETE FROM'), field('table', target), optional($.where_clause));
|
|
155
155
|
|
|
156
156
|
export default grammar({
|
|
157
|
+
caseInsensitiveKeywords: true,
|
|
157
158
|
name: 'sqlite',
|
|
158
159
|
|
|
159
160
|
// A byte order mark is white space anywhere.
|
|
@@ -174,12 +175,12 @@ export default grammar({
|
|
|
174
175
|
word: ($) => $.identifier,
|
|
175
176
|
|
|
176
177
|
reserved: {
|
|
177
|
-
global: () => RESERVED.map(
|
|
178
|
+
global: () => RESERVED.map(keyword),
|
|
178
179
|
// `ids` in parse.y: the alias that follows an expression or a table without `AS`, a type name, or a collation.
|
|
179
|
-
ids: () => [...RESERVED, ...JOIN_KEYWORDS, 'INDEXED'].map(
|
|
180
|
-
window_name: () => [...RESERVED, 'FILTER', 'INDEXED'].map(
|
|
180
|
+
ids: () => [...RESERVED, ...JOIN_KEYWORDS, 'INDEXED'].map(keyword),
|
|
181
|
+
window_name: () => [...RESERVED, 'FILTER', 'INDEXED'].map(keyword),
|
|
181
182
|
// `id` in parse.y: an identifier as a default value.
|
|
182
|
-
id: () => [...RESERVED, ...JOIN_KEYWORDS].map(
|
|
183
|
+
id: () => [...RESERVED, ...JOIN_KEYWORDS].map(keyword),
|
|
183
184
|
},
|
|
184
185
|
|
|
185
186
|
supertypes: ($) => [$._statement],
|
package/tree-sitter-mysql.wasm
CHANGED
|
Binary file
|
package/tree-sitter-oracle.wasm
CHANGED
|
Binary file
|
|
Binary file
|
package/tree-sitter-sqlite.wasm
CHANGED
|
Binary file
|