@atom8n/codemirror-lang-sql 1.3.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/.turbo/turbo-build.log +4 -0
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/build.tsbuildinfo +1 -0
- package/dist/complete.d.ts +7 -0
- package/dist/complete.js +180 -0
- package/dist/complete.js.map +1 -0
- package/dist/grammar.sql.d.ts +2 -0
- package/dist/grammar.sql.js +20 -0
- package/dist/grammar.sql.js.map +1 -0
- package/dist/grammar.sql.terms.d.ts +1 -0
- package/dist/grammar.sql.terms.js +5 -0
- package/dist/grammar.sql.terms.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/sql.d.ts +60 -0
- package/dist/sql.js +231 -0
- package/dist/sql.js.map +1 -0
- package/dist/tokens.d.ts +24 -0
- package/dist/tokens.js +343 -0
- package/dist/tokens.js.map +1 -0
- package/eslint.config.mjs +13 -0
- package/jest.config.js +6 -0
- package/package.json +53 -0
- package/tsconfig.build.json +10 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/.pnpm/typescript@5.9.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/jest-expect-message/types/index.d.ts","../../../../node_modules/.pnpm/@codemirror+state@6.4.1/node_modules/@codemirror/state/dist/index.d.ts","../../../../node_modules/.pnpm/style-mod@4.1.0/node_modules/style-mod/src/style-mod.d.ts","../../../../node_modules/.pnpm/@codemirror+view@6.26.3/node_modules/@codemirror/view/dist/index.d.ts","../../../../node_modules/.pnpm/@lezer+common@1.2.1/node_modules/@lezer/common/dist/index.d.ts","../../../../node_modules/.pnpm/@codemirror+autocomplete@6.16.0_@codemirror+language@6.10.1_@codemirror+state@6.4.1_@co_04cea374553a6c4341e0cc5f5f6a6a66/node_modules/@codemirror/autocomplete/dist/index.d.ts","../../../../node_modules/.pnpm/@lezer+lr@1.4.0/node_modules/@lezer/lr/dist/index.d.ts","../../../../node_modules/.pnpm/@lezer+highlight@1.1.1_patch_hash=97f85e6fe46f23015ea0dd420e33d584bc2dc71633910cf131321da31b27ca8c/node_modules/@lezer/highlight/dist/highlight.d.ts","../../../../node_modules/.pnpm/@codemirror+language@6.10.1/node_modules/@codemirror/language/dist/index.d.ts","../src/grammar.sql.terms.ts","../src/complete.ts","../src/tokens.ts","../src/grammar.sql.ts","../../../../node_modules/.pnpm/@codemirror+state@6.3.3/node_modules/@codemirror/state/dist/index.d.ts","../../../../node_modules/.pnpm/@codemirror+view@6.22.3/node_modules/@codemirror/view/dist/index.d.ts","../../../../node_modules/.pnpm/@codemirror+language@6.9.3/node_modules/@codemirror/language/dist/index.d.ts","../../codemirror-lang/dist/expressions/index.d.ts","../../codemirror-lang/dist/index.d.ts","../src/sql.ts","../src/index.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/compatibility/disposable.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/compatibility/indexable.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/compatibility/iterators.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/compatibility/index.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/globals.typedarray.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/buffer.buffer.d.ts","../../../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/header.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/readable.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/file.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/fetch.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/formdata.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/connector.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/client.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/errors.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/dispatcher.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/global-dispatcher.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/global-origin.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/pool-stats.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/handlers.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/balanced-pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/mock-interceptor.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/mock-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/mock-client.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/mock-pool.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/mock-errors.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/proxy-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/retry-handler.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/retry-agent.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/api.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/interceptors.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/util.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/cookies.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/patch.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/websocket.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/eventsource.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/filereader.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/diagnostics-channel.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/content-type.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/cache.d.ts","../../../../node_modules/.pnpm/undici-types@6.19.8/node_modules/undici-types/index.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/globals.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/assert.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/buffer.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/child_process.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/cluster.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/console.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/constants.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/crypto.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/dgram.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/dns.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/domain.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/dom-events.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/events.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/fs.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/http.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/http2.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/https.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/inspector.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/module.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/net.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/os.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/path.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/process.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/punycode.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/querystring.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/readline.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/readline/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/repl.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/sea.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/stream.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/stream/web.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/test.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/timers.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/tls.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/trace_events.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/tty.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/url.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/util.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/v8.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/vm.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/wasi.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/zlib.d.ts","../../../../node_modules/.pnpm/@types+node@20.17.57/node_modules/@types/node/index.d.ts"],"fileIdsList":[[54,56,57,78,121],[54,55,56,57,59,60,78,121],[55,57,59,60,66,67,78,121],[78,121],[54,55,78,121],[57,78,121],[78,118,121],[78,120,121],[121],[78,121,126,155],[78,121,122,127,133,134,141,152,163],[78,121,122,123,133,141],[73,74,75,78,121],[78,121,124,164],[78,121,125,126,134,142],[78,121,126,152,160],[78,121,127,129,133,141],[78,120,121,128],[78,121,129,130],[78,121,131,133],[78,120,121,133],[78,121,133,134,135,152,163],[78,121,133,134,135,148,152,155],[78,116,121],[78,121,129,133,136,141,152,163],[78,121,133,134,136,137,141,152,160,163],[78,121,136,138,152,160,163],[76,77,78,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[78,121,133,139],[78,121,140,163,168],[78,121,129,133,141,152],[78,121,142],[78,121,143],[78,120,121,144],[78,118,119,120,121,122,123,124,125,126,127,128,129,130,131,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[78,121,146],[78,121,147],[78,121,133,148,149],[78,121,148,150,164,166],[78,121,133,152,153,155],[78,121,154,155],[78,121,152,153],[78,121,155],[78,121,156],[78,118,121,152],[78,121,133,158,159],[78,121,158,159],[78,121,126,141,152,160],[78,121,161],[78,121,141,162],[78,121,136,147,163],[78,121,126,164],[78,121,152,165],[78,121,140,166],[78,121,167],[78,121,133,135,144,152,155,163,166,168],[78,121,152,169],[78,88,92,121,163],[78,88,121,152,163],[78,83,121],[78,85,88,121,160,163],[78,121,141,160],[78,121,170],[78,83,121,170],[78,85,88,121,141,163],[78,80,81,84,87,121,133,152,163],[78,88,95,121],[78,80,86,121],[78,88,109,110,121],[78,84,88,121,155,163,170],[78,109,121,170],[78,82,83,121,170],[78,88,121],[78,82,83,84,85,86,87,88,89,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,110,111,112,113,114,115,121],[78,88,103,121],[78,88,95,96,121],[78,86,88,96,97,121],[78,87,121],[78,80,83,88,121],[78,88,92,96,97,121],[78,92,121],[78,86,88,91,121,163],[78,80,85,88,95,121],[78,121,152],[78,83,88,109,121,168,170],[54,57,58,61,62,78,121],[59,64,78,121],[63,71,78,121],[54,57,58,60,61,63,64,65,70,78,121],[59,62,78,121],[59,68,78,121],[69,78,121]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"406a5a771d97867cba07e7fbd3cd1fb2dd1004558b973733205737e9dd7ed929","affectsGlobalScope":true,"impliedFormat":1},{"version":"ee77aa598a528f724562dba2a766d58dc0dd8003bc7ebae9c4432862cba96454","impliedFormat":99},{"version":"fe9dd679e568dc2a0e5e6959f77b53f8bc1f126d46b0d17631347ba57470b808","impliedFormat":99},{"version":"c472104d0e98c461a60939841dbb34dc7e7d80e353d29c95c8902777adc92fe0","impliedFormat":99},{"version":"b7568d221108717cee204ad1e8b0e25044fbff3bdeb09de8ca579c869a13da5f","impliedFormat":99},{"version":"d7f24468be108aaa3daade2059834d2b21c4ea58d55285a11d1614cc44f8132e","impliedFormat":99},{"version":"7d470d5054929cb61ab1f1bd67cb6fab6561e6b16f33fd608138889f90d7a5ab","impliedFormat":99},{"version":"b064c20877a7f8d5538627ff165fedffc686555b4d6ea929b85eb2c63dafe409","impliedFormat":99},{"version":"770d7280b35b74fdd88f28356e4e1b8524c924fd21f64d5709226b9dedab84d8","impliedFormat":99},{"version":"5d7494d72970e4b9441a9319f93143619c199cfee72a32fae2768ddfaac23521","signature":"4eb08e72c7450909bc2b02386e3c794c84a513f4856d8c436e73be9e433cf21f"},{"version":"7af295826ac2393790418bec449c113f7e845aca06fc77d3ea8d70e6a10e54e5","signature":"0bbeaa7267dedab18970ff3bc003724288b6054b0767b89dbe50fcd8c7e59b35"},{"version":"bf7d871e80ca4be2d5ceea6ed7de772d177eb634c72bdb1d9cb8b2f4a6795125","signature":"36338ceb48b16891c0ed160f3498c3804cea64ec61cbfb277a547fd96ceece6f"},{"version":"9323472019a06b1c1ddba9229fabcd83c7b83d02351b56330d70fc553d679995","signature":"9516ab1055d47d47ad7a13b664c82dfc5ead0368b1ef6e59ab474e2f57beef09"},{"version":"bdc579bd44341a33714bb14c0cd507b2f7df8ea31932048f3106b4c47f70cd32","impliedFormat":99},{"version":"1a57e7fa161f86a3e56fc165dd8eae0a73baa7dd63170cbd89b020cd683add22","impliedFormat":99},{"version":"c452ff3c523f9e299cae6176cef118586b8ec19e1bad73604616a39c8fd8e47f","impliedFormat":99},"e19cb5ed84118329758d22bdff9069fd4524c6d104a3e35f12387c8c68064ca8","6476727e4a520605dedec183d7f59d765da639f60eeabf3963dfdf078538be4e",{"version":"6cb62eb85571cfb2e519faa7720a07822500777faf6e0363e151aafbba481703","signature":"dbc19ae436f0c0518aedd05587999f088fe6b7ae7678a10609227aacf03851ff"},"3e3d8ba4c2e6e1c42de6477ff76fe065960315888fa5e61b4af730dc43f03114",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"49a5a44f2e68241a1d2bd9ec894535797998841c09729e506a7cbfcaa40f2180","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","impliedFormat":1},{"version":"93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","impliedFormat":1},{"version":"339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b8582f8bf95b9b901bf6cf47b9ee3560c7f340be0bd39cb432f21e9e136c36a7","affectsGlobalScope":true,"impliedFormat":1},{"version":"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"8c0bcd6c6b67b4b503c11e91a1fb91522ed585900eab2ab1f61bba7d7caa9d6f","impliedFormat":1},{"version":"9e025aa38cad40827cc30aca974fe33fe2c4652fe8c88f48dadbbbd6300c8b07","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","impliedFormat":1},{"version":"84c1930e33d1bb12ad01bcbe11d656f9646bd21b2fb2afd96e8e10615a021aef","impliedFormat":1},{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4b87f767c7bc841511113c876a6b8bf1fd0cb0b718c888ad84478b372ec486b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","impliedFormat":1},{"version":"9d19808c8c291a9010a6c788e8532a2da70f811adb431c97520803e0ec649991","impliedFormat":1},{"version":"5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","impliedFormat":1},{"version":"e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","impliedFormat":1},{"version":"f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45","impliedFormat":1},{"version":"71450bbc2d82821d24ca05699a533e72758964e9852062c53b30f31c36978ab8","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c21aaa8257d7950a5b75a251d9075b6a371208fc948c9c8402f6690ef3b5b55","impliedFormat":1},{"version":"b5895e6353a5d708f55d8685c38a235c3a6d8138e374dee8ceb8ffde5aa8002a","impliedFormat":1},{"version":"5b75ca915164e4a7ad94a60729fe45b8a62e7750ab232d0122f8ccdd768f5314","impliedFormat":1},{"version":"93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","impliedFormat":1},{"version":"4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","impliedFormat":1},{"version":"dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e","impliedFormat":1},{"version":"1354ca5c38bd3fd3836a68e0f7c9f91f172582ba30ab15bb8c075891b91502b7","affectsGlobalScope":true,"impliedFormat":1},{"version":"5155da3047ef977944d791a2188ff6e6c225f6975cc1910ab7bb6838ab84cede","impliedFormat":1},{"version":"93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","impliedFormat":1},{"version":"afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5","impliedFormat":1},{"version":"3e5b3163e34f3dc24cba59db4bb90bcc33555cccac06b707501439bdcf3d4df4","affectsGlobalScope":true,"impliedFormat":1},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","impliedFormat":1},{"version":"b4f70ec656a11d570e1a9edce07d118cd58d9760239e2ece99306ee9dfe61d02","impliedFormat":1},{"version":"3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"5b6844ad931dcc1d3aca53268f4bd671428421464b1286746027aede398094f2","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"0dbcebe2126d03936c70545e96a6e41007cf065be38a1ce4d32a39fcedefead4","affectsGlobalScope":true,"impliedFormat":1},{"version":"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb","impliedFormat":1},{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true,"impliedFormat":1},{"version":"12ed4559eba17cd977aa0db658d25c4047067444b51acfdcbf38470630642b23","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3ffabc95802521e1e4bcba4c88d8615176dc6e09111d920c7a213bdda6e1d65","impliedFormat":1},{"version":"c40b3d3cfbb1227c8935f681c2480a32b560e387dd771d329cdbd1641f2d6da5","impliedFormat":1},{"version":"ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","impliedFormat":1},{"version":"a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9","impliedFormat":1},{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true,"impliedFormat":1},{"version":"c4a3720550d1787c8d6284040853c0781ff1e2cd8d842f2cb44547525ee34c36","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","impliedFormat":1},{"version":"f008d63ce0077f533e39df44b82d660707b15b0f8e31fbc153a62bb00b99bfe5","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"6bdb3144f8bf020f513651a6ea1cb8a378a612c0791042e0436fd9adf7372a17","affectsGlobalScope":true,"impliedFormat":1},{"version":"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","impliedFormat":1},{"version":"cac793cc47c29e26e4ac3601dcb00b4435ebed26203485790e44f2ad8b6ad847","impliedFormat":1}],"root":[53,[62,65],71,72],"options":{"declaration":true,"esModuleInterop":true,"module":1,"noImplicitAny":true,"noImplicitReturns":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"strictNullChecks":true,"target":8,"tsBuildInfoFile":"./build.tsbuildinfo","useUnknownInCatchVariables":true},"referencedMap":[[58,1],[61,2],[68,3],[66,4],[54,4],[67,5],[56,5],[57,4],[60,6],[59,6],[118,7],[119,7],[120,8],[78,9],[121,10],[122,11],[123,12],[73,4],[76,13],[74,4],[75,4],[124,14],[125,15],[126,16],[127,17],[128,18],[129,19],[130,19],[132,4],[131,20],[133,21],[134,22],[135,23],[117,24],[77,4],[136,25],[137,26],[138,27],[170,28],[139,29],[140,30],[141,31],[142,32],[143,33],[144,34],[145,35],[146,36],[147,37],[148,38],[149,38],[150,39],[151,4],[152,40],[154,41],[153,42],[155,43],[156,44],[157,45],[158,46],[159,47],[160,48],[161,49],[162,50],[163,51],[164,52],[165,53],[166,54],[167,55],[168,56],[169,57],[79,4],[55,4],[51,4],[52,4],[9,4],[11,4],[10,4],[2,4],[12,4],[13,4],[14,4],[15,4],[16,4],[17,4],[18,4],[19,4],[3,4],[20,4],[21,4],[4,4],[22,4],[26,4],[23,4],[24,4],[25,4],[27,4],[28,4],[29,4],[5,4],[30,4],[31,4],[32,4],[33,4],[6,4],[37,4],[34,4],[35,4],[36,4],[38,4],[7,4],[39,4],[44,4],[45,4],[40,4],[41,4],[42,4],[43,4],[8,4],[49,4],[46,4],[47,4],[48,4],[50,4],[1,4],[95,58],[105,59],[94,58],[115,60],[86,61],[85,62],[114,63],[108,64],[113,65],[88,66],[102,67],[87,68],[111,69],[83,70],[82,63],[112,71],[84,72],[89,73],[90,4],[93,73],[80,4],[116,74],[106,75],[97,76],[98,77],[100,78],[96,79],[99,80],[109,63],[91,81],[92,82],[101,83],[81,84],[104,75],[103,73],[107,4],[110,85],[53,4],[63,86],[62,4],[65,87],[72,88],[71,89],[64,90],[69,91],[70,92]],"version":"5.9.2"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Completion, CompletionSource } from '@codemirror/autocomplete';
|
|
2
|
+
export declare function completeFromSchema(schema: {
|
|
3
|
+
[table: string]: ReadonlyArray<string | Completion>;
|
|
4
|
+
}, tables?: readonly Completion[], schemas?: readonly Completion[], defaultTableName?: string, defaultSchemaName?: string): CompletionSource;
|
|
5
|
+
export declare function completeKeywords(keywords: {
|
|
6
|
+
[name: string]: number;
|
|
7
|
+
}, upperCase: boolean): CompletionSource;
|
package/dist/complete.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.completeFromSchema = completeFromSchema;
|
|
4
|
+
exports.completeKeywords = completeKeywords;
|
|
5
|
+
const autocomplete_1 = require("@codemirror/autocomplete");
|
|
6
|
+
const language_1 = require("@codemirror/language");
|
|
7
|
+
const grammar_sql_terms_1 = require("./grammar.sql.terms");
|
|
8
|
+
const skippedTokens = ['Whitespace'];
|
|
9
|
+
function tokenBefore(tree) {
|
|
10
|
+
const cursor = tree.cursor().moveTo(tree.from, -1);
|
|
11
|
+
while (/Comment/.test(cursor.name))
|
|
12
|
+
cursor.moveTo(cursor.from, -1);
|
|
13
|
+
return cursor.node;
|
|
14
|
+
}
|
|
15
|
+
function idName(doc, node) {
|
|
16
|
+
const text = doc.sliceString(node.from, node.to);
|
|
17
|
+
const quoted = /^([`'"])(.*)\1$/.exec(text);
|
|
18
|
+
return quoted ? quoted[2] : text;
|
|
19
|
+
}
|
|
20
|
+
function plainID(node) {
|
|
21
|
+
return node && (node.name === 'Identifier' || node.name === 'QuotedIdentifier');
|
|
22
|
+
}
|
|
23
|
+
function pathFor(doc, id) {
|
|
24
|
+
if (id.name === 'CompositeIdentifier') {
|
|
25
|
+
const path = [];
|
|
26
|
+
for (let ch = id.firstChild; ch; ch = ch.nextSibling)
|
|
27
|
+
if (plainID(ch))
|
|
28
|
+
path.push(idName(doc, ch));
|
|
29
|
+
return path;
|
|
30
|
+
}
|
|
31
|
+
return [idName(doc, id)];
|
|
32
|
+
}
|
|
33
|
+
function parentsFor(doc, node) {
|
|
34
|
+
for (let path = [];;) {
|
|
35
|
+
if (!node || node.name !== '.')
|
|
36
|
+
return path;
|
|
37
|
+
const name = tokenBefore(node);
|
|
38
|
+
if (!plainID(name))
|
|
39
|
+
return path;
|
|
40
|
+
path.unshift(idName(doc, name));
|
|
41
|
+
node = tokenBefore(name);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function sourceContext(state, startPos) {
|
|
45
|
+
const pos = (0, language_1.syntaxTree)(state).resolveInner(startPos, -1);
|
|
46
|
+
const aliases = getAliases(state.doc, pos);
|
|
47
|
+
if (pos.name === 'Identifier' || pos.name === 'QuotedIdentifier' || pos.name === 'Keyword') {
|
|
48
|
+
return {
|
|
49
|
+
from: pos.from,
|
|
50
|
+
quoted: pos.name === 'QuotedIdentifier' ? state.doc.sliceString(pos.from, pos.from + 1) : null,
|
|
51
|
+
parents: parentsFor(state.doc, tokenBefore(pos)),
|
|
52
|
+
aliases,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (pos.name === '.') {
|
|
56
|
+
return { from: startPos, quoted: null, parents: parentsFor(state.doc, pos), aliases };
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return { from: startPos, quoted: null, parents: [], empty: true, aliases };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const EndFrom = new Set('where group having order union intersect except all distinct limit offset fetch for'.split(' '));
|
|
63
|
+
function getAliases(doc, at) {
|
|
64
|
+
let statement;
|
|
65
|
+
for (let parent = at; !statement; parent = parent.parent) {
|
|
66
|
+
if (!parent)
|
|
67
|
+
return null;
|
|
68
|
+
if (parent.name === 'Statement')
|
|
69
|
+
statement = parent;
|
|
70
|
+
}
|
|
71
|
+
let aliases = null;
|
|
72
|
+
for (let scan = statement.firstChild, sawFrom = false, prevID = null; scan; scan = scan.nextSibling) {
|
|
73
|
+
if (skippedTokens.includes(scan.name))
|
|
74
|
+
continue;
|
|
75
|
+
const kw = scan.name === 'Keyword' ? doc.sliceString(scan.from, scan.to).toLowerCase() : null;
|
|
76
|
+
let alias = null;
|
|
77
|
+
if (!sawFrom) {
|
|
78
|
+
sawFrom = kw === 'from';
|
|
79
|
+
}
|
|
80
|
+
else if (kw === 'as' && prevID) {
|
|
81
|
+
let next = scan.nextSibling;
|
|
82
|
+
while (next && skippedTokens.includes(next.name))
|
|
83
|
+
next = next.nextSibling;
|
|
84
|
+
if (plainID(next))
|
|
85
|
+
alias = idName(doc, next);
|
|
86
|
+
}
|
|
87
|
+
else if (kw && EndFrom.has(kw)) {
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
else if (prevID && plainID(scan)) {
|
|
91
|
+
alias = idName(doc, scan);
|
|
92
|
+
}
|
|
93
|
+
if (alias) {
|
|
94
|
+
aliases ??= Object.create(null);
|
|
95
|
+
if (aliases) {
|
|
96
|
+
aliases[alias] = pathFor(doc, prevID);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
prevID = /Identifier$/.test(scan.name) ? scan : null;
|
|
100
|
+
}
|
|
101
|
+
return aliases;
|
|
102
|
+
}
|
|
103
|
+
function maybeQuoteCompletions(quote, completions) {
|
|
104
|
+
if (!quote)
|
|
105
|
+
return completions;
|
|
106
|
+
return completions.map((c) => ({ ...c, label: quote + c.label + quote, apply: undefined }));
|
|
107
|
+
}
|
|
108
|
+
const Span = /^\w*$/, QuotedSpan = /^[`'"]?\w*[`'"]?$/;
|
|
109
|
+
class CompletionLevel {
|
|
110
|
+
constructor() {
|
|
111
|
+
this.list = [];
|
|
112
|
+
this.children = undefined;
|
|
113
|
+
}
|
|
114
|
+
child(name) {
|
|
115
|
+
const children = this.children || (this.children = Object.create(null));
|
|
116
|
+
return children[name] || (children[name] = new CompletionLevel());
|
|
117
|
+
}
|
|
118
|
+
childCompletions(type) {
|
|
119
|
+
return this.children
|
|
120
|
+
? Object.keys(this.children)
|
|
121
|
+
.filter((x) => x)
|
|
122
|
+
.map((name) => ({ label: name, type }))
|
|
123
|
+
: [];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function completeFromSchema(schema, tables, schemas, defaultTableName, defaultSchemaName) {
|
|
127
|
+
const top = new CompletionLevel();
|
|
128
|
+
const defaultSchema = top.child(defaultSchemaName || '');
|
|
129
|
+
for (const table in schema) {
|
|
130
|
+
const dot = table.indexOf('.');
|
|
131
|
+
const schemaCompletions = dot > -1 ? top.child(table.slice(0, dot)) : defaultSchema;
|
|
132
|
+
const tableCompletions = schemaCompletions.child(dot > -1 ? table.slice(dot + 1) : table);
|
|
133
|
+
tableCompletions.list = schema[table].map((val) => typeof val === 'string' ? { label: val, type: 'property' } : val);
|
|
134
|
+
}
|
|
135
|
+
defaultSchema.list = (tables || defaultSchema.childCompletions('type')).concat(defaultTableName ? defaultSchema.child(defaultTableName).list : []);
|
|
136
|
+
for (const sName in top.children) {
|
|
137
|
+
const schema = top.child(sName);
|
|
138
|
+
if (!schema.list.length)
|
|
139
|
+
schema.list = schema.childCompletions('type');
|
|
140
|
+
}
|
|
141
|
+
top.list = defaultSchema.list.concat(schemas || top.childCompletions('type'));
|
|
142
|
+
return (context) => {
|
|
143
|
+
let { parents, from, quoted, empty, aliases } = sourceContext(context.state, context.pos);
|
|
144
|
+
if (empty && !context.explicit)
|
|
145
|
+
return null;
|
|
146
|
+
if (aliases && parents.length === 1)
|
|
147
|
+
parents = aliases[parents[0]] || parents;
|
|
148
|
+
let level = top;
|
|
149
|
+
for (const name of parents) {
|
|
150
|
+
while (!level.children?.[name]) {
|
|
151
|
+
if (level === top)
|
|
152
|
+
level = defaultSchema;
|
|
153
|
+
else if (level === defaultSchema && defaultTableName)
|
|
154
|
+
level = level.child(defaultTableName);
|
|
155
|
+
else
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
level = level.child(name);
|
|
159
|
+
}
|
|
160
|
+
const quoteAfter = quoted && context.state.sliceDoc(context.pos, context.pos + 1) === quoted;
|
|
161
|
+
let options = level.list;
|
|
162
|
+
if (level === top && aliases)
|
|
163
|
+
options = options.concat(Object.keys(aliases).map((name) => ({ label: name, type: 'constant' })));
|
|
164
|
+
return {
|
|
165
|
+
from,
|
|
166
|
+
to: quoteAfter ? context.pos + 1 : undefined,
|
|
167
|
+
options: maybeQuoteCompletions(quoted, options),
|
|
168
|
+
validFor: quoted ? QuotedSpan : Span,
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function completeKeywords(keywords, upperCase) {
|
|
173
|
+
const completions = Object.keys(keywords).map((keyword) => ({
|
|
174
|
+
label: upperCase ? keyword.toUpperCase() : keyword,
|
|
175
|
+
type: keywords[keyword] === grammar_sql_terms_1.Type ? 'type' : keywords[keyword] === grammar_sql_terms_1.Keyword ? 'keyword' : 'variable',
|
|
176
|
+
boost: -1,
|
|
177
|
+
}));
|
|
178
|
+
return (0, autocomplete_1.ifNotIn)(['QuotedIdentifier', 'SpecialVar', 'String', 'LineComment', 'BlockComment', '.'], (0, autocomplete_1.completeFromList)(completions));
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=complete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete.js","sourceRoot":"","sources":["../src/complete.ts"],"names":[],"mappings":";;AAqIA,gDAqDC;AAED,4CAWC;AAtMD,2DAAqE;AACrE,mDAAkD;AAIlD,2DAAoD;AAEpD,MAAM,aAAa,GAAG,CAAC,YAAY,CAAC,CAAC;AAErC,SAAS,WAAW,CAAC,IAAgB;IACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,MAAM,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,SAAS,MAAM,CAAC,GAAS,EAAE,IAAgB;IAC1C,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,C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GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC3D,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO;QAClD,IAAI,EACH,QAAQ,CAAC,OAAO,CAAC,KAAK,wBAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,2BAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;QAC7F,KAAK,EAAE,CAAC,CAAC;KACT,CAAC,CAAC,CAAC;IACJ,OAAO,IAAA,sBAAO,EACb,CAAC,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,CAAC,EAChF,IAAA,+BAAgB,EAAC,WAAW,CAAC,CAC7B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parser = void 0;
|
|
4
|
+
const lr_1 = require("@lezer/lr");
|
|
5
|
+
const tokens_1 = require("./tokens");
|
|
6
|
+
exports.parser = lr_1.LRParser.deserialize({
|
|
7
|
+
version: 14,
|
|
8
|
+
states: "&SQ]QQOOO#wQRO'#DTO$OQQO'#CyO%eQQO'#CzO%lQQO'#C{O%sQQO'#C|OOQQ'#DT'#DTO%zQQO'#DTOOQQ'#DP'#DPO'ZQRO'#C}OOQQ'#Cx'#CxOOQQ'#DO'#DOQ]QQOOQOQQOOO'eQQO'#DQO(}QRO,59eO)UQQO,59eO)ZQQO'#DTOOQQ,59f,59fO)hQQO,59fOOQQ,59g,59gO)oQQO,59gOOQQ,59h,59hO)vQQO,59hOOQQ,59o,59oOOQQ-E6}-E6}OOQQ,59d,59dOOQQ-E6|-E6|OOQQ,59l,59lOOQQ-E7O-E7OO+[QRO1G/PO+cQQO,59eOOQQ1G/Q1G/QOOQQ1G/R1G/ROOQQ1G/S1G/SP+pQQO'#DPO+wQQO1G/PO)UQQO,59eO,UQQO'#Cy",
|
|
9
|
+
stateData: ",a~OPOSQOSROS~OSUOTUOUUOVUOWROYSO[TO^YO_QO`UOaUObPOcPOdPOeUOfUOgUOhUOiUO~O_^OSwXTwXUwXVwXWwXYwX[wX^wX`wXawXbwXcwXdwXewXfwXgwXhwXiwX~OuwX~P!jOb`Oc`Od`O~OSUOTUOUUOVUOWROYSO[TO_vO`UOaUObaOcaOdaOeUOfUOgUOhUOiUO~OXbO~P$ZOZdO~P$ZO]fO~P$ZOjhO~OSUOTUOUUOVUOWROYSO[TO_QO`UOaUObPOcPOdPOeUOfUOgUOhUOiUO~O^jOuqX~P&POblOclOdlO~O_^OSmaTmaUmaVmaWmaYma[ma^ma`maamabmacmadmaemafmagmahmaima~Ouma~P'pO_^O~OXwXZwX]wX~P!jOXpO~P$ZOZqO~P$ZO]rO~P$ZO_^OSmiTmiUmiVmiWmiYmi[mi^mi`miamibmicmidmiemifmigmihmiimi~Oumi~P)}OXmaZma]ma~P'pO^jO~P$ZOXmiZmi]mi~P)}ObuOcuOduO~O",
|
|
10
|
+
goto: '#uxPPPPPPPPPPPPPPPPPPPPPPPPPPPPy}}}!Z!g!k!q#VPP#iTZO[eUORSTX[cegseVORSTX[cegsT]O[Q[ORk[SXO[QcRQeSQgTZiXcegsQ_PWm_notQn`QoaRtueWORSTX[cegs',
|
|
11
|
+
nodeNames: '⚠ Whitespace LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Function Script Statement CompositeIdentifier Parens Braces Brackets Statement',
|
|
12
|
+
maxTerm: 39,
|
|
13
|
+
skippedNodes: [0, 1, 2, 3],
|
|
14
|
+
repeatNodeCount: 3,
|
|
15
|
+
tokenData: 'RORO',
|
|
16
|
+
tokenizers: [0, tokens_1.tokens],
|
|
17
|
+
topRules: { Script: [0, 27] },
|
|
18
|
+
tokenPrec: 0,
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=grammar.sql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar.sql.js","sourceRoot":"","sources":["../src/grammar.sql.ts"],"names":[],"mappings":";;;AACA,kCAAqC;AACrC,qCAAkC;AACrB,QAAA,MAAM,GAAG,aAAQ,CAAC,WAAW,CAAC;IAC1C,OAAO,EAAE,EAAE;IACX,MAAM,EACL,8ZAA8Z;IAC/Z,SAAS,EACR,6hBAA6hB;IAC9hB,IAAI,EAAE,2IAA2I;IACjJ,SAAS,EACR,0PAA0P;IAC3P,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1B,eAAe,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,CAAC,CAAC,EAAE,eAAM,CAAC;IACvB,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;IAC7B,SAAS,EAAE,CAAC;CACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Whitespace = 1, LineComment = 2, BlockComment = 3, String = 4, Number = 5, Bool = 6, Null = 7, ParenL = 8, ParenR = 9, BraceL = 10, BraceR = 11, BracketL = 12, BracketR = 13, Semi = 14, Dot = 15, Operator = 16, Punctuation = 17, SpecialVar = 18, Identifier = 19, QuotedIdentifier = 20, Keyword = 21, Type = 22, Bits = 23, Bytes = 24, Builtin = 25, Function = 26, Script = 27;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Script = exports.Function = exports.Builtin = exports.Bytes = exports.Bits = exports.Type = exports.Keyword = exports.QuotedIdentifier = exports.Identifier = exports.SpecialVar = exports.Punctuation = exports.Operator = exports.Dot = exports.Semi = exports.BracketR = exports.BracketL = exports.BraceR = exports.BraceL = exports.ParenR = exports.ParenL = exports.Null = exports.Bool = exports.Number = exports.String = exports.BlockComment = exports.LineComment = exports.Whitespace = void 0;
|
|
4
|
+
exports.Whitespace = 1, exports.LineComment = 2, exports.BlockComment = 3, exports.String = 4, exports.Number = 5, exports.Bool = 6, exports.Null = 7, exports.ParenL = 8, exports.ParenR = 9, exports.BraceL = 10, exports.BraceR = 11, exports.BracketL = 12, exports.BracketR = 13, exports.Semi = 14, exports.Dot = 15, exports.Operator = 16, exports.Punctuation = 17, exports.SpecialVar = 18, exports.Identifier = 19, exports.QuotedIdentifier = 20, exports.Keyword = 21, exports.Type = 22, exports.Bits = 23, exports.Bytes = 24, exports.Builtin = 25, exports.Function = 26, exports.Script = 27;
|
|
5
|
+
//# sourceMappingURL=grammar.sql.terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar.sql.terms.js","sourceRoot":"","sources":["../src/grammar.sql.terms.ts"],"names":[],"mappings":";;;AACa,QAAA,UAAU,GAAG,CAAC,EAC1B,QAAA,WAAW,GAAG,CAAC,EACf,QAAA,YAAY,GAAG,CAAC,EAChB,QAAA,MAAM,GAAG,CAAC,EACV,QAAA,MAAM,GAAG,CAAC,EACV,QAAA,IAAI,GAAG,CAAC,EACR,QAAA,IAAI,GAAG,CAAC,EACR,QAAA,MAAM,GAAG,CAAC,EACV,QAAA,MAAM,GAAG,CAAC,EACV,QAAA,MAAM,GAAG,EAAE,EACX,QAAA,MAAM,GAAG,EAAE,EACX,QAAA,QAAQ,GAAG,EAAE,EACb,QAAA,QAAQ,GAAG,EAAE,EACb,QAAA,IAAI,GAAG,EAAE,EACT,QAAA,GAAG,GAAG,EAAE,EACR,QAAA,QAAQ,GAAG,EAAE,EACb,QAAA,WAAW,GAAG,EAAE,EAChB,QAAA,UAAU,GAAG,EAAE,EACf,QAAA,UAAU,GAAG,EAAE,EACf,QAAA,gBAAgB,GAAG,EAAE,EACrB,QAAA,OAAO,GAAG,EAAE,EACZ,QAAA,IAAI,GAAG,EAAE,EACT,QAAA,IAAI,GAAG,EAAE,EACT,QAAA,KAAK,GAAG,EAAE,EACV,QAAA,OAAO,GAAG,EAAE,EACZ,QAAA,QAAQ,GAAG,EAAE,EACb,QAAA,MAAM,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sql"), exports);
|
|
18
|
+
__exportStar(require("./complete"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,6CAA2B"}
|
package/dist/sql.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Completion, CompletionSource } from '@codemirror/autocomplete';
|
|
2
|
+
import { LanguageSupport, LRLanguage } from '@codemirror/language';
|
|
3
|
+
import type { Extension } from '@codemirror/state';
|
|
4
|
+
import type { Dialect } from './tokens';
|
|
5
|
+
export declare const getParser: (dialect: Dialect) => {
|
|
6
|
+
mixedLanguage: LRLanguage;
|
|
7
|
+
sqlLanguage: LRLanguage;
|
|
8
|
+
};
|
|
9
|
+
export type SQLDialectSpec = {
|
|
10
|
+
keywords?: string;
|
|
11
|
+
functions?: string;
|
|
12
|
+
builtin?: string;
|
|
13
|
+
types?: string;
|
|
14
|
+
backslashEscapes?: boolean;
|
|
15
|
+
hashComments?: boolean;
|
|
16
|
+
slashComments?: boolean;
|
|
17
|
+
spaceAfterDashes?: boolean;
|
|
18
|
+
doubleDollarQuotedStrings?: boolean;
|
|
19
|
+
doubleQuotedStrings?: boolean;
|
|
20
|
+
charSetCasts?: boolean;
|
|
21
|
+
operatorChars?: string;
|
|
22
|
+
specialVar?: string;
|
|
23
|
+
identifierQuotes?: string;
|
|
24
|
+
unquotedBitLiterals?: boolean;
|
|
25
|
+
treatBitsAsBytes?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare class SQLDialect {
|
|
28
|
+
readonly dialect: Dialect;
|
|
29
|
+
readonly language: LRLanguage;
|
|
30
|
+
readonly spec: SQLDialectSpec;
|
|
31
|
+
readonly sqlLanguage: LRLanguage;
|
|
32
|
+
private constructor();
|
|
33
|
+
get extension(): Extension;
|
|
34
|
+
static define(spec: SQLDialectSpec): SQLDialect;
|
|
35
|
+
}
|
|
36
|
+
export interface SQLConfig {
|
|
37
|
+
dialect?: SQLDialect;
|
|
38
|
+
schema?: {
|
|
39
|
+
[table: string]: ReadonlyArray<string | Completion>;
|
|
40
|
+
};
|
|
41
|
+
tables?: readonly Completion[];
|
|
42
|
+
schemas?: readonly Completion[];
|
|
43
|
+
defaultTable?: string;
|
|
44
|
+
defaultSchema?: string;
|
|
45
|
+
upperCaseKeywords?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare function keywordCompletionSource(dialect: SQLDialect, upperCase?: boolean): CompletionSource;
|
|
48
|
+
export declare function keywordCompletion(dialect: SQLDialect, upperCase?: boolean): Extension;
|
|
49
|
+
export declare function schemaCompletionSource(config: SQLConfig): CompletionSource;
|
|
50
|
+
export declare function schemaCompletion(config: SQLConfig): Extension;
|
|
51
|
+
export declare function sql(config?: SQLConfig): LanguageSupport;
|
|
52
|
+
export declare const StandardSQL: SQLDialect;
|
|
53
|
+
export declare const PostgreSQL: SQLDialect;
|
|
54
|
+
export declare const MySQL: SQLDialect;
|
|
55
|
+
export declare const MariaSQL: SQLDialect;
|
|
56
|
+
export declare const MSSQL: SQLDialect;
|
|
57
|
+
export declare const SQLite: SQLDialect;
|
|
58
|
+
export declare const Cassandra: SQLDialect;
|
|
59
|
+
export declare const PLSQL: SQLDialect;
|
|
60
|
+
export declare const OracleDB: SQLDialect;
|
package/dist/sql.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OracleDB = exports.PLSQL = exports.Cassandra = exports.SQLite = exports.MSSQL = exports.MariaSQL = exports.MySQL = exports.PostgreSQL = exports.StandardSQL = exports.SQLDialect = exports.getParser = void 0;
|
|
4
|
+
exports.keywordCompletionSource = keywordCompletionSource;
|
|
5
|
+
exports.keywordCompletion = keywordCompletion;
|
|
6
|
+
exports.schemaCompletionSource = schemaCompletionSource;
|
|
7
|
+
exports.schemaCompletion = schemaCompletion;
|
|
8
|
+
exports.sql = sql;
|
|
9
|
+
const language_1 = require("@codemirror/language");
|
|
10
|
+
const common_1 = require("@lezer/common");
|
|
11
|
+
const highlight_1 = require("@lezer/highlight");
|
|
12
|
+
const codemirror_lang_1 = require("@n8n/codemirror-lang");
|
|
13
|
+
const complete_1 = require("./complete");
|
|
14
|
+
const grammar_sql_1 = require("./grammar.sql");
|
|
15
|
+
const tokens_1 = require("./tokens");
|
|
16
|
+
const getSqlParser = () => {
|
|
17
|
+
return grammar_sql_1.parser.configure({
|
|
18
|
+
props: [
|
|
19
|
+
language_1.indentNodeProp.add({
|
|
20
|
+
Statement: (0, language_1.continuedIndent)(),
|
|
21
|
+
}),
|
|
22
|
+
language_1.foldNodeProp.add({
|
|
23
|
+
Statement(tree) {
|
|
24
|
+
return { from: tree.firstChild.to, to: tree.to };
|
|
25
|
+
},
|
|
26
|
+
BlockComment(tree) {
|
|
27
|
+
return { from: tree.from + 2, to: tree.to - 2 };
|
|
28
|
+
},
|
|
29
|
+
}),
|
|
30
|
+
(0, highlight_1.styleTags)({
|
|
31
|
+
Keyword: highlight_1.tags.keyword,
|
|
32
|
+
Type: highlight_1.tags.typeName,
|
|
33
|
+
Builtin: highlight_1.tags.standard(highlight_1.tags.name),
|
|
34
|
+
Bits: highlight_1.tags.number,
|
|
35
|
+
Bytes: highlight_1.tags.string,
|
|
36
|
+
Bool: highlight_1.tags.bool,
|
|
37
|
+
Null: highlight_1.tags.null,
|
|
38
|
+
Number: highlight_1.tags.number,
|
|
39
|
+
String: highlight_1.tags.string,
|
|
40
|
+
Identifier: highlight_1.tags.name,
|
|
41
|
+
QuotedIdentifier: highlight_1.tags.special(highlight_1.tags.string),
|
|
42
|
+
SpecialVar: highlight_1.tags.special(highlight_1.tags.name),
|
|
43
|
+
LineComment: highlight_1.tags.lineComment,
|
|
44
|
+
BlockComment: highlight_1.tags.blockComment,
|
|
45
|
+
Operator: highlight_1.tags.operator,
|
|
46
|
+
Function: highlight_1.tags.function(highlight_1.tags.variableName),
|
|
47
|
+
'Semi Punctuation': highlight_1.tags.punctuation,
|
|
48
|
+
'( )': highlight_1.tags.paren,
|
|
49
|
+
'{ }': highlight_1.tags.brace,
|
|
50
|
+
'[ ]': highlight_1.tags.squareBracket,
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const getParser = (dialect) => {
|
|
56
|
+
const sqlLangData = {
|
|
57
|
+
commentTokens: { line: '--', block: { open: '/*', close: '*/' } },
|
|
58
|
+
closeBrackets: { brackets: ['(', '[', '{', "'", '"', '`'] },
|
|
59
|
+
};
|
|
60
|
+
const sqlParser = getSqlParser().configure({
|
|
61
|
+
tokenizers: [{ from: tokens_1.tokens, to: (0, tokens_1.tokensFor)(dialect) }],
|
|
62
|
+
});
|
|
63
|
+
const sqlLanguage = language_1.LRLanguage.define({
|
|
64
|
+
name: 'sql',
|
|
65
|
+
parser: sqlParser,
|
|
66
|
+
languageData: sqlLangData,
|
|
67
|
+
});
|
|
68
|
+
const mixedParser = codemirror_lang_1.expressionParser.configure({
|
|
69
|
+
wrap: (0, common_1.parseMixed)((node) => {
|
|
70
|
+
return node.type.isTop
|
|
71
|
+
? {
|
|
72
|
+
parser: sqlLanguage.parser,
|
|
73
|
+
overlay: (node) => node.type.name === 'Plaintext',
|
|
74
|
+
}
|
|
75
|
+
: null;
|
|
76
|
+
}),
|
|
77
|
+
});
|
|
78
|
+
const mixedLanguage = language_1.LRLanguage.define({
|
|
79
|
+
parser: mixedParser,
|
|
80
|
+
name: 'expressionParser',
|
|
81
|
+
});
|
|
82
|
+
return { mixedLanguage, sqlLanguage };
|
|
83
|
+
};
|
|
84
|
+
exports.getParser = getParser;
|
|
85
|
+
class SQLDialect {
|
|
86
|
+
constructor(dialect, language, spec, sqlLanguage) {
|
|
87
|
+
this.dialect = dialect;
|
|
88
|
+
this.language = language;
|
|
89
|
+
this.spec = spec;
|
|
90
|
+
this.sqlLanguage = sqlLanguage;
|
|
91
|
+
}
|
|
92
|
+
get extension() {
|
|
93
|
+
return this.language.extension;
|
|
94
|
+
}
|
|
95
|
+
static define(spec) {
|
|
96
|
+
const d = (0, tokens_1.dialect)(spec, spec.keywords, spec.types, spec.builtin, spec.functions);
|
|
97
|
+
const { mixedLanguage, sqlLanguage } = (0, exports.getParser)(d);
|
|
98
|
+
const language = mixedLanguage;
|
|
99
|
+
return new SQLDialect(d, language, spec, sqlLanguage);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.SQLDialect = SQLDialect;
|
|
103
|
+
function keywordCompletionSource(dialect, upperCase = false) {
|
|
104
|
+
return (0, complete_1.completeKeywords)(dialect.dialect.words, upperCase);
|
|
105
|
+
}
|
|
106
|
+
function keywordCompletion(dialect, upperCase = false) {
|
|
107
|
+
return dialect.sqlLanguage.data.of({
|
|
108
|
+
autocomplete: keywordCompletionSource(dialect, upperCase),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function schemaCompletionSource(config) {
|
|
112
|
+
return config.schema
|
|
113
|
+
? (0, complete_1.completeFromSchema)(config.schema, config.tables, config.schemas, config.defaultTable, config.defaultSchema)
|
|
114
|
+
: () => null;
|
|
115
|
+
}
|
|
116
|
+
function schemaCompletion(config) {
|
|
117
|
+
return config.schema
|
|
118
|
+
? (config.dialect || exports.StandardSQL).sqlLanguage.data.of({
|
|
119
|
+
autocomplete: schemaCompletionSource(config),
|
|
120
|
+
})
|
|
121
|
+
: [];
|
|
122
|
+
}
|
|
123
|
+
function sql(config = {}) {
|
|
124
|
+
const lang = config.dialect || exports.StandardSQL;
|
|
125
|
+
return new language_1.LanguageSupport(lang.language, [
|
|
126
|
+
schemaCompletion(config),
|
|
127
|
+
keywordCompletion(lang, !!config.upperCaseKeywords),
|
|
128
|
+
]);
|
|
129
|
+
}
|
|
130
|
+
exports.StandardSQL = SQLDialect.define({});
|
|
131
|
+
exports.PostgreSQL = SQLDialect.define({
|
|
132
|
+
charSetCasts: true,
|
|
133
|
+
doubleDollarQuotedStrings: true,
|
|
134
|
+
operatorChars: '+-*/<>=~!@#%^&|`?',
|
|
135
|
+
specialVar: '',
|
|
136
|
+
functions: tokens_1.SQLFunctions +
|
|
137
|
+
'abs aggregate array_agg array_max_cardinality avg decode encode bernoulli cardinality ceil ceiling char_length character_length coalesce corr degrees substring system xmlcomment xmlvalidate xmlexists length strip lower upper bit_length normalize mod octet_length overlay ln sqrt power exp log lower',
|
|
138
|
+
keywords: tokens_1.SQLKeywords +
|
|
139
|
+
'abort absent access according ada admin alias also always analyse analyze asensitive assert assignment asymmetric atomic attach attribute attributes backward base64 begin_frame begin_partition bit_length blocked bom c cache called catalog_name chain character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion g generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull k key_member key_type label lag last_value lead leakproof least length library like_regex link listen load location lock locked logged m mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octets off offset oids operator options ordering others over overriding owned owner p parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring_regex succeeds sum symmetric sysid system system_time t table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes',
|
|
140
|
+
types: tokens_1.SQLTypes +
|
|
141
|
+
'bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml',
|
|
142
|
+
});
|
|
143
|
+
const MySQLKeywords = 'accessible algorithm analyze asensitive authors auto_increment autocommit avg avg_row_length binlog btree cache catalog_name chain change changed checkpoint checksum class_origin client_statistics coalesce code collations columns comment committed completion concurrent consistent contains contributors convert database databases day_hour day_microsecond day_minute day_second delay_key_write delayed delimiter des_key_file dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile enable enclosed ends engine engines enum errors escaped even event events every explain extended fast field fields flush force found_rows fulltext grants handler hash high_priority hosts hour_microsecond hour_minute hour_second ignore ignore_server_ids import index index_statistics infile innodb insensitive insert_method install invoker iterate keys kill linear lines list load lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modify mutex mysql_errno no_write_to_binlog offline offset one online optimize optionally outfile pack_keys parser partition partitions password phase plugin plugins prev processlist profile profiles purge query quick range read_write rebuild recover regexp relaylog remove rename reorganize repair repeatable replace require resume rlike row_format rtree schedule schema_name schemas second_microsecond security sensitive separator serializable server share show slave slow snapshot soname spatial sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result ssl starting starts std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace terminated triggers truncate uncommitted uninstall unlock upgrade use use_frm user_resources user_statistics utc_date utc_time utc_timestamp variables views warnings xa xor year_month zerofill';
|
|
144
|
+
const MySQLTypes = tokens_1.SQLTypes +
|
|
145
|
+
'bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int1 int2 int3 int4 int8 float4 float8 varbinary varcharacter precision datetime unsigned signed';
|
|
146
|
+
const MySQLBuiltin = 'charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee';
|
|
147
|
+
exports.MySQL = SQLDialect.define({
|
|
148
|
+
operatorChars: '*+-%<>!=&|^',
|
|
149
|
+
charSetCasts: true,
|
|
150
|
+
doubleQuotedStrings: true,
|
|
151
|
+
unquotedBitLiterals: true,
|
|
152
|
+
hashComments: true,
|
|
153
|
+
spaceAfterDashes: true,
|
|
154
|
+
specialVar: '@?',
|
|
155
|
+
identifierQuotes: '`',
|
|
156
|
+
functions: tokens_1.SQLFunctions,
|
|
157
|
+
keywords: tokens_1.SQLKeywords + 'group_concat ' + MySQLKeywords,
|
|
158
|
+
types: MySQLTypes,
|
|
159
|
+
builtin: MySQLBuiltin,
|
|
160
|
+
});
|
|
161
|
+
exports.MariaSQL = SQLDialect.define({
|
|
162
|
+
operatorChars: '*+-%<>!=&|^',
|
|
163
|
+
charSetCasts: true,
|
|
164
|
+
doubleQuotedStrings: true,
|
|
165
|
+
unquotedBitLiterals: true,
|
|
166
|
+
hashComments: true,
|
|
167
|
+
spaceAfterDashes: true,
|
|
168
|
+
specialVar: '@?',
|
|
169
|
+
identifierQuotes: '`',
|
|
170
|
+
functions: tokens_1.SQLFunctions,
|
|
171
|
+
keywords: tokens_1.SQLKeywords +
|
|
172
|
+
'always generated groupby_concat hard persistent shutdown soft virtual ' +
|
|
173
|
+
MySQLKeywords,
|
|
174
|
+
types: MySQLTypes,
|
|
175
|
+
builtin: MySQLBuiltin,
|
|
176
|
+
});
|
|
177
|
+
exports.MSSQL = SQLDialect.define({
|
|
178
|
+
functions: tokens_1.SQLFunctions,
|
|
179
|
+
keywords: tokens_1.SQLKeywords +
|
|
180
|
+
'trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec go if use index holdlock nolock nowait paglock pivot readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot tablock tablockx unpivot updlock with',
|
|
181
|
+
types: tokens_1.SQLTypes +
|
|
182
|
+
'bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml',
|
|
183
|
+
builtin: 'binary_checksum checksum connectionproperty context_info current_request_id error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big xact_state object_id',
|
|
184
|
+
operatorChars: '*+-%<>!=^&|/',
|
|
185
|
+
specialVar: '@',
|
|
186
|
+
});
|
|
187
|
+
exports.SQLite = SQLDialect.define({
|
|
188
|
+
functions: tokens_1.SQLFunctions + 'isnull notnull',
|
|
189
|
+
keywords: tokens_1.SQLKeywords +
|
|
190
|
+
'abort analyze attach autoincrement conflict database detach exclusive fail glob ignore index indexed instead offset plan pragma query raise regexp reindex rename replace temp vacuum virtual',
|
|
191
|
+
types: tokens_1.SQLTypes +
|
|
192
|
+
'bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int2 int8 unsigned signed real',
|
|
193
|
+
builtin: 'auth backup bail changes clone databases dbinfo dump echo eqp explain fullschema headers help import imposter indexes iotrace lint load log mode nullvalue once print prompt quit restore save scanstats separator shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width',
|
|
194
|
+
operatorChars: '*+-%<>!=&|/~',
|
|
195
|
+
identifierQuotes: '`"',
|
|
196
|
+
specialVar: '@:?$',
|
|
197
|
+
});
|
|
198
|
+
exports.Cassandra = SQLDialect.define({
|
|
199
|
+
functions: 'to_timestamp to_unix_timestamp to_date cast abs round sqrt count sum max avg min log log10 now min_timeuuid max_timeuuid current_timestamp current_date current_time current_timeuuid',
|
|
200
|
+
keywords: 'add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime infinity NaN',
|
|
201
|
+
types: tokens_1.SQLTypes +
|
|
202
|
+
'ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint',
|
|
203
|
+
slashComments: true,
|
|
204
|
+
});
|
|
205
|
+
exports.PLSQL = SQLDialect.define({
|
|
206
|
+
functions: tokens_1.SQLFunctions,
|
|
207
|
+
keywords: tokens_1.SQLKeywords +
|
|
208
|
+
'abort accept access add all alter and any arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body by case cast char_base check close cluster clusters colauth column comment commit compress connected constant constraint crash create current currval cursor data_base database dba deallocate debugoff debugon declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry exception exception_init exchange exclusive exists external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base of off offline on online only option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw rebuild record ref references refresh rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work',
|
|
209
|
+
builtin: 'appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define echo editfile embedded feedback flagger flush heading headsep instance linesize lno loboffset logsource longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar repfooter repheader serveroutput shiftinout show showmode spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout timing trimout trimspool ttitle underline verify version wrap',
|
|
210
|
+
types: tokens_1.SQLTypes +
|
|
211
|
+
'ascii bfile bfilename bigserial bit blob dec long number nvarchar nvarchar2 serial smallint string text uid varchar2 xml',
|
|
212
|
+
operatorChars: '*/+-%<>!=~',
|
|
213
|
+
doubleQuotedStrings: true,
|
|
214
|
+
charSetCasts: true,
|
|
215
|
+
});
|
|
216
|
+
exports.OracleDB = SQLDialect.define({
|
|
217
|
+
operatorChars: '*/+-<>=!',
|
|
218
|
+
doubleQuotedStrings: true,
|
|
219
|
+
charSetCasts: true,
|
|
220
|
+
functions: tokens_1.SQLFunctions +
|
|
221
|
+
' acos asin atan atan2 bitand ceil chr cos cosh cosine_distance count decode exp extract floor greatest inner_product json_array json_arrayagg json_exists json_object json_objectagg json_query json_scalar json_serialize json_table json_transform json_value l1_distance l2_distance least length lower initcap lpad ltrim max median min mod nvl nvl2 nullif power replace round rpad regexp_instr regexp_replace regexp_substr sign sqrt stddev substr to_blob to_char to_clob to_clob to_date to_number to_ncclob to_timestamp to_timestamp_tz to_vector to_vector translate trunc trim upper uuid vector_distance vector_embedding vector_serialize xmlquery xmltable',
|
|
222
|
+
keywords: tokens_1.SQLKeywords +
|
|
223
|
+
'access char check cluster dual noaudit nocompress nowait null offline pctfree rename resource rowid rowlabel rownum share size smallint successful synonym sysdate uid validate varchar varchar2',
|
|
224
|
+
types: 'binary_double binary_float blob bfile boolean char clob date decimal double float integer interval day to second smallint interval year to month json long longraw nchar nclob number nvarchar2 raw rowid timestamp timestamp with local time zone timestamp with time zone urowid vector varchar2 xmltype',
|
|
225
|
+
builtin: 'current_date current_timestamp dbtimezone level localtimestamp rowid rownum sql%found sql%isopen sql%notfound sql%rowcount sessiontimezone sysdate systimestamp user',
|
|
226
|
+
hashComments: false,
|
|
227
|
+
slashComments: false,
|
|
228
|
+
spaceAfterDashes: true,
|
|
229
|
+
doubleDollarQuotedStrings: false,
|
|
230
|
+
});
|
|
231
|
+
//# sourceMappingURL=sql.js.map
|
package/dist/sql.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql.js","sourceRoot":"","sources":["../src/sql.ts"],"names":[],"mappings":";;;AAkMA,0DAEC;AAGD,8CAIC;AAID,wDAUC;AAGD,4CAMC;AAKD,kBAMC;AA5OD,mDAM8B;AAE9B,0CAA2C;AAC3C,gDAAwD;AACxD,0DAAwD;AAExD,yCAAkE;AAClE,+CAAqD;AAErD,qCAA2F;AAE3F,MAAM,YAAY,GAAG,GAAG,EAAE;IACzB,OAAO,oBAAU,CAAC,SAAS,CAAC;QAC3B,KAAK,EAAE;YACN,yBAAc,CAAC,GAAG,CAAC;gBAClB,SAAS,EAAE,IAAA,0BAAe,GAAE;aAC5B,CAAC;YACF,uBAAY,CAAC,GAAG,CAAC;gBAChB,SAAS,CAAC,IAAI;oBACb,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,UAAW,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;gBACnD,CAAC;gBACD,YAAY,CAAC,IAAI;oBAChB,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI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Q,EACP,wiBAAwiB;IACziB,KAAK,EACJ,iBAAQ;QACR,uFAAuF;IACxF,aAAa,EAAE,IAAI;CACnB,CAAC,CAAC;AAGU,QAAA,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,qBAAY;IACvB,QAAQ,EACP,oBAAW;QACX,unDAAunD;IACxnD,OAAO,EACN,4mBAA4mB;IAC7mB,KAAK,EACJ,iBAAQ;QACR,0HAA0H;IAC3H,aAAa,EAAE,YAAY;IAC3B,mBAAmB,EAAE,IAAI;IACzB,YAAY,EAAE,IAAI;CAClB,CAAC,CAAC;AAGU,QAAA,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC;IACzC,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE,IAAI;IACzB,YAAY,EAAE,IAAI;IAClB,SAAS,EACR,qBAAY;QACZ,8oBAA8oB;IAC/oB,QAAQ,EACP,oBAAW;QACX,kMAAkM;IACnM,KAAK,EACJ,4SAA4S;IAC7S,OAAO,EACN,sKAAsK;IACvK,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,KAAK;IACpB,gBAAgB,EAAE,IAAI;IACtB,yBAAyB,EAAE,KAAK;CAChC,CAAC,CAAC"}
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ExternalTokenizer } from '@lezer/lr';
|
|
2
|
+
export interface Dialect {
|
|
3
|
+
backslashEscapes: boolean;
|
|
4
|
+
hashComments: boolean;
|
|
5
|
+
spaceAfterDashes: boolean;
|
|
6
|
+
slashComments: boolean;
|
|
7
|
+
doubleQuotedStrings: boolean;
|
|
8
|
+
doubleDollarQuotedStrings: boolean;
|
|
9
|
+
unquotedBitLiterals: boolean;
|
|
10
|
+
treatBitsAsBytes: boolean;
|
|
11
|
+
charSetCasts: boolean;
|
|
12
|
+
operatorChars: string;
|
|
13
|
+
specialVar: string;
|
|
14
|
+
identifierQuotes: string;
|
|
15
|
+
words: {
|
|
16
|
+
[name: string]: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare const SQLTypes = "array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ";
|
|
20
|
+
export declare const SQLFunctions = "abs absolute case check cast concat coalesce cube collate count current_date current_path current_role current_time current_timestamp current_user day exists grouping hour localtime localtimestamp minute month second trim session_user size system_user treat unnest user year equals lower upper pow floor ceil exp log ifnull min max avg sum sqrt round ";
|
|
21
|
+
export declare const SQLKeywords = "action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded catalog close collation column commit condition connect connection constraint constraints constructor continue corresponding create cross current current_default_transform_group current_transform_group_for_type cursor cycle data deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exit external fetch first for foreign found from free full function general get global go goto grant group handle having hold identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local locator loop map match method modifies module names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search section select session set sets signal similar some space specific specifictype sql sqlexception sqlstate sqlwarning start state static table temporary then timezone_hour timezone_minute to trailing transaction translation trigger under undo union unique until update usage using value values view when whenever where while with without work write zone ";
|
|
22
|
+
export declare function dialect(spec: Partial<Dialect>, kws?: string, types?: string, builtin?: string, functions?: string): Dialect;
|
|
23
|
+
export declare function tokensFor(d: Dialect): ExternalTokenizer;
|
|
24
|
+
export declare const tokens: ExternalTokenizer;
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tokens = exports.SQLKeywords = exports.SQLFunctions = exports.SQLTypes = void 0;
|
|
4
|
+
exports.dialect = dialect;
|
|
5
|
+
exports.tokensFor = tokensFor;
|
|
6
|
+
const lr_1 = require("@lezer/lr");
|
|
7
|
+
const grammar_sql_terms_1 = require("./grammar.sql.terms");
|
|
8
|
+
var Ch;
|
|
9
|
+
(function (Ch) {
|
|
10
|
+
Ch[Ch["Newline"] = 10] = "Newline";
|
|
11
|
+
Ch[Ch["Space"] = 32] = "Space";
|
|
12
|
+
Ch[Ch["DoubleQuote"] = 34] = "DoubleQuote";
|
|
13
|
+
Ch[Ch["Hash"] = 35] = "Hash";
|
|
14
|
+
Ch[Ch["Dollar"] = 36] = "Dollar";
|
|
15
|
+
Ch[Ch["SingleQuote"] = 39] = "SingleQuote";
|
|
16
|
+
Ch[Ch["ParenL"] = 40] = "ParenL";
|
|
17
|
+
Ch[Ch["ParenR"] = 41] = "ParenR";
|
|
18
|
+
Ch[Ch["Star"] = 42] = "Star";
|
|
19
|
+
Ch[Ch["Plus"] = 43] = "Plus";
|
|
20
|
+
Ch[Ch["Comma"] = 44] = "Comma";
|
|
21
|
+
Ch[Ch["Dash"] = 45] = "Dash";
|
|
22
|
+
Ch[Ch["Dot"] = 46] = "Dot";
|
|
23
|
+
Ch[Ch["Slash"] = 47] = "Slash";
|
|
24
|
+
Ch[Ch["Colon"] = 58] = "Colon";
|
|
25
|
+
Ch[Ch["Semi"] = 59] = "Semi";
|
|
26
|
+
Ch[Ch["Question"] = 63] = "Question";
|
|
27
|
+
Ch[Ch["At"] = 64] = "At";
|
|
28
|
+
Ch[Ch["BracketL"] = 91] = "BracketL";
|
|
29
|
+
Ch[Ch["BracketR"] = 93] = "BracketR";
|
|
30
|
+
Ch[Ch["Backslash"] = 92] = "Backslash";
|
|
31
|
+
Ch[Ch["Underscore"] = 95] = "Underscore";
|
|
32
|
+
Ch[Ch["Backtick"] = 96] = "Backtick";
|
|
33
|
+
Ch[Ch["BraceL"] = 123] = "BraceL";
|
|
34
|
+
Ch[Ch["BraceR"] = 125] = "BraceR";
|
|
35
|
+
Ch[Ch["A"] = 65] = "A";
|
|
36
|
+
Ch[Ch["a"] = 97] = "a";
|
|
37
|
+
Ch[Ch["B"] = 66] = "B";
|
|
38
|
+
Ch[Ch["b"] = 98] = "b";
|
|
39
|
+
Ch[Ch["E"] = 69] = "E";
|
|
40
|
+
Ch[Ch["e"] = 101] = "e";
|
|
41
|
+
Ch[Ch["F"] = 70] = "F";
|
|
42
|
+
Ch[Ch["f"] = 102] = "f";
|
|
43
|
+
Ch[Ch["N"] = 78] = "N";
|
|
44
|
+
Ch[Ch["n"] = 110] = "n";
|
|
45
|
+
Ch[Ch["X"] = 88] = "X";
|
|
46
|
+
Ch[Ch["x"] = 120] = "x";
|
|
47
|
+
Ch[Ch["Z"] = 90] = "Z";
|
|
48
|
+
Ch[Ch["z"] = 122] = "z";
|
|
49
|
+
Ch[Ch["_0"] = 48] = "_0";
|
|
50
|
+
Ch[Ch["_1"] = 49] = "_1";
|
|
51
|
+
Ch[Ch["_9"] = 57] = "_9";
|
|
52
|
+
})(Ch || (Ch = {}));
|
|
53
|
+
function isAlpha(ch) {
|
|
54
|
+
return (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122) || (ch >= 48 && ch <= 57);
|
|
55
|
+
}
|
|
56
|
+
function isHexDigit(ch) {
|
|
57
|
+
return (ch >= 48 && ch <= 57) || (ch >= 97 && ch <= 102) || (ch >= 65 && ch <= 70);
|
|
58
|
+
}
|
|
59
|
+
function readLiteral(input, endQuote, backslashEscapes) {
|
|
60
|
+
for (let escaped = false;;) {
|
|
61
|
+
if (input.next < 0)
|
|
62
|
+
return;
|
|
63
|
+
if (input.next === endQuote && !escaped) {
|
|
64
|
+
input.advance();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
escaped = backslashEscapes && !escaped && input.next === 92;
|
|
68
|
+
input.advance();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function readDoubleDollarLiteral(input) {
|
|
72
|
+
for (;;) {
|
|
73
|
+
if (input.next < 0 || input.peek(1) < 0)
|
|
74
|
+
return;
|
|
75
|
+
if (input.next === 36 && input.peek(1) === 36) {
|
|
76
|
+
input.advance(2);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
input.advance();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function readWord(input, result) {
|
|
83
|
+
for (;;) {
|
|
84
|
+
if (input.next !== 95 && !isAlpha(input.next))
|
|
85
|
+
break;
|
|
86
|
+
if (result !== null)
|
|
87
|
+
result += String.fromCharCode(input.next);
|
|
88
|
+
input.advance();
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
function readWordOrQuoted(input) {
|
|
93
|
+
if (input.next === 39 ||
|
|
94
|
+
input.next === 34 ||
|
|
95
|
+
input.next === 96) {
|
|
96
|
+
const quote = input.next;
|
|
97
|
+
input.advance();
|
|
98
|
+
readLiteral(input, quote, false);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
readWord(input);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function readBits(input, endQuote) {
|
|
105
|
+
while (input.next === 48 || input.next === 49)
|
|
106
|
+
input.advance();
|
|
107
|
+
if (endQuote && input.next === endQuote)
|
|
108
|
+
input.advance();
|
|
109
|
+
}
|
|
110
|
+
function readNumber(input, sawDot) {
|
|
111
|
+
for (;;) {
|
|
112
|
+
if (input.next === 46) {
|
|
113
|
+
if (sawDot)
|
|
114
|
+
break;
|
|
115
|
+
sawDot = true;
|
|
116
|
+
}
|
|
117
|
+
else if (input.next < 48 || input.next > 57) {
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
input.advance();
|
|
121
|
+
}
|
|
122
|
+
if (input.next === 69 || input.next === 101) {
|
|
123
|
+
input.advance();
|
|
124
|
+
const advancedInput = input;
|
|
125
|
+
if (advancedInput.next === 43 || advancedInput.next === 45)
|
|
126
|
+
input.advance();
|
|
127
|
+
while (input.next >= 48 && input.next <= 57)
|
|
128
|
+
input.advance();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function eol(input) {
|
|
132
|
+
while (!(input.next < 0 || input.next === 10))
|
|
133
|
+
input.advance();
|
|
134
|
+
}
|
|
135
|
+
function inString(ch, str) {
|
|
136
|
+
for (let i = 0; i < str.length; i++)
|
|
137
|
+
if (str.charCodeAt(i) === ch)
|
|
138
|
+
return true;
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
const Space = ' \t\r\n';
|
|
142
|
+
function keywords(keywords, types, builtin, functions) {
|
|
143
|
+
const result = Object.create(null);
|
|
144
|
+
result['true'] = result['false'] = grammar_sql_terms_1.Bool;
|
|
145
|
+
result['null'] = result['unknown'] = grammar_sql_terms_1.Null;
|
|
146
|
+
for (const kw of keywords.split(' '))
|
|
147
|
+
if (kw)
|
|
148
|
+
result[kw] = grammar_sql_terms_1.Keyword;
|
|
149
|
+
for (const tp of types.split(' '))
|
|
150
|
+
if (tp)
|
|
151
|
+
result[tp] = grammar_sql_terms_1.Type;
|
|
152
|
+
for (const kw of (builtin || '').split(' '))
|
|
153
|
+
if (kw)
|
|
154
|
+
result[kw] = grammar_sql_terms_1.Builtin;
|
|
155
|
+
for (const fn of (functions || '').split(' '))
|
|
156
|
+
if (fn)
|
|
157
|
+
result[fn] = grammar_sql_terms_1.Function;
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
exports.SQLTypes = 'array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ';
|
|
161
|
+
exports.SQLFunctions = 'abs absolute case check cast concat coalesce cube collate count current_date current_path current_role current_time current_timestamp current_user day exists grouping hour localtime localtimestamp minute month second trim session_user size system_user treat unnest user year equals lower upper pow floor ceil exp log ifnull min max avg sum sqrt round ';
|
|
162
|
+
exports.SQLKeywords = 'action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded catalog close collation column commit condition connect connection constraint constraints constructor continue corresponding create cross current current_default_transform_group current_transform_group_for_type cursor cycle data deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exit external fetch first for foreign found from free full function general get global go goto grant group handle having hold identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local locator loop map match method modifies module names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search section select session set sets signal similar some space specific specifictype sql sqlexception sqlstate sqlwarning start state static table temporary then timezone_hour timezone_minute to trailing transaction translation trigger under undo union unique until update usage using value values view when whenever where while with without work write zone ';
|
|
163
|
+
const defaults = {
|
|
164
|
+
backslashEscapes: false,
|
|
165
|
+
hashComments: false,
|
|
166
|
+
spaceAfterDashes: false,
|
|
167
|
+
slashComments: false,
|
|
168
|
+
doubleQuotedStrings: false,
|
|
169
|
+
doubleDollarQuotedStrings: false,
|
|
170
|
+
unquotedBitLiterals: false,
|
|
171
|
+
treatBitsAsBytes: false,
|
|
172
|
+
charSetCasts: false,
|
|
173
|
+
operatorChars: '*+-%<>!==&|~^/',
|
|
174
|
+
specialVar: '?',
|
|
175
|
+
identifierQuotes: '"',
|
|
176
|
+
words: keywords(exports.SQLKeywords, exports.SQLTypes, '', exports.SQLFunctions),
|
|
177
|
+
};
|
|
178
|
+
function dialect(spec, kws, types, builtin, functions) {
|
|
179
|
+
const dialect = {};
|
|
180
|
+
for (const prop in defaults)
|
|
181
|
+
dialect[prop] = (Object.prototype.hasOwnProperty.call(spec, prop) ? spec : defaults)[prop];
|
|
182
|
+
if (kws)
|
|
183
|
+
dialect.words = keywords(kws, types || '', builtin, functions);
|
|
184
|
+
return dialect;
|
|
185
|
+
}
|
|
186
|
+
function tokensFor(d) {
|
|
187
|
+
return new lr_1.ExternalTokenizer((input) => {
|
|
188
|
+
const { next } = input;
|
|
189
|
+
input.advance();
|
|
190
|
+
if (inString(next, Space)) {
|
|
191
|
+
while (inString(input.next, Space))
|
|
192
|
+
input.advance();
|
|
193
|
+
input.acceptToken(grammar_sql_terms_1.Whitespace);
|
|
194
|
+
}
|
|
195
|
+
else if (next === 36 && input.next === 36 && d.doubleDollarQuotedStrings) {
|
|
196
|
+
readDoubleDollarLiteral(input);
|
|
197
|
+
input.acceptToken(grammar_sql_terms_1.String);
|
|
198
|
+
}
|
|
199
|
+
else if (next === 39 || (next === 34 && d.doubleQuotedStrings)) {
|
|
200
|
+
readLiteral(input, next, d.backslashEscapes);
|
|
201
|
+
input.acceptToken(grammar_sql_terms_1.String);
|
|
202
|
+
}
|
|
203
|
+
else if ((next === 35 && d.hashComments) ||
|
|
204
|
+
(next === 47 && input.next === 47 && d.slashComments)) {
|
|
205
|
+
eol(input);
|
|
206
|
+
input.acceptToken(grammar_sql_terms_1.LineComment);
|
|
207
|
+
}
|
|
208
|
+
else if (next === 45 &&
|
|
209
|
+
input.next === 45 &&
|
|
210
|
+
(!d.spaceAfterDashes || input.peek(1) === 32)) {
|
|
211
|
+
eol(input);
|
|
212
|
+
input.acceptToken(grammar_sql_terms_1.LineComment);
|
|
213
|
+
}
|
|
214
|
+
else if (next === 47 && input.next === 42) {
|
|
215
|
+
input.advance();
|
|
216
|
+
for (let depth = 1;;) {
|
|
217
|
+
const cur = input.next;
|
|
218
|
+
if (input.next < 0)
|
|
219
|
+
break;
|
|
220
|
+
input.advance();
|
|
221
|
+
if (cur === 42 && input.next === 47) {
|
|
222
|
+
depth--;
|
|
223
|
+
input.advance();
|
|
224
|
+
if (!depth)
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
else if (cur === 47 && input.next === 42) {
|
|
228
|
+
depth++;
|
|
229
|
+
input.advance();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
input.acceptToken(grammar_sql_terms_1.BlockComment);
|
|
233
|
+
}
|
|
234
|
+
else if ((next === 101 || next === 69) && input.next === 39) {
|
|
235
|
+
input.advance();
|
|
236
|
+
readLiteral(input, 39, true);
|
|
237
|
+
}
|
|
238
|
+
else if ((next === 110 || next === 78) &&
|
|
239
|
+
input.next === 39 &&
|
|
240
|
+
d.charSetCasts) {
|
|
241
|
+
input.advance();
|
|
242
|
+
readLiteral(input, 39, d.backslashEscapes);
|
|
243
|
+
input.acceptToken(grammar_sql_terms_1.String);
|
|
244
|
+
}
|
|
245
|
+
else if (next === 95 && d.charSetCasts) {
|
|
246
|
+
for (let i = 0;; i++) {
|
|
247
|
+
if (input.next === 39 && i > 1) {
|
|
248
|
+
input.advance();
|
|
249
|
+
readLiteral(input, 39, d.backslashEscapes);
|
|
250
|
+
input.acceptToken(grammar_sql_terms_1.String);
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
if (!isAlpha(input.next))
|
|
254
|
+
break;
|
|
255
|
+
input.advance();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else if (next === 40) {
|
|
259
|
+
input.acceptToken(grammar_sql_terms_1.ParenL);
|
|
260
|
+
}
|
|
261
|
+
else if (next === 41) {
|
|
262
|
+
input.acceptToken(grammar_sql_terms_1.ParenR);
|
|
263
|
+
}
|
|
264
|
+
else if (next === 123) {
|
|
265
|
+
input.acceptToken(grammar_sql_terms_1.BraceL);
|
|
266
|
+
}
|
|
267
|
+
else if (next === 125) {
|
|
268
|
+
input.acceptToken(grammar_sql_terms_1.BraceR);
|
|
269
|
+
}
|
|
270
|
+
else if (next === 91) {
|
|
271
|
+
input.acceptToken(grammar_sql_terms_1.BracketL);
|
|
272
|
+
}
|
|
273
|
+
else if (next === 93) {
|
|
274
|
+
input.acceptToken(grammar_sql_terms_1.BracketR);
|
|
275
|
+
}
|
|
276
|
+
else if (next === 59) {
|
|
277
|
+
input.acceptToken(grammar_sql_terms_1.Semi);
|
|
278
|
+
}
|
|
279
|
+
else if (d.unquotedBitLiterals && next === 48 && input.next === 98) {
|
|
280
|
+
input.advance();
|
|
281
|
+
readBits(input);
|
|
282
|
+
input.acceptToken(grammar_sql_terms_1.Bits);
|
|
283
|
+
}
|
|
284
|
+
else if ((next === 98 || next === 66) &&
|
|
285
|
+
(input.next === 39 || input.next === 34)) {
|
|
286
|
+
const quoteStyle = input.next;
|
|
287
|
+
input.advance();
|
|
288
|
+
if (d.treatBitsAsBytes) {
|
|
289
|
+
readLiteral(input, quoteStyle, d.backslashEscapes);
|
|
290
|
+
input.acceptToken(grammar_sql_terms_1.Bytes);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
readBits(input, quoteStyle);
|
|
294
|
+
input.acceptToken(grammar_sql_terms_1.Bits);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
else if ((next === 48 && (input.next === 120 || input.next === 88)) ||
|
|
298
|
+
((next === 120 || next === 88) && input.next === 39)) {
|
|
299
|
+
const quoted = input.next === 39;
|
|
300
|
+
input.advance();
|
|
301
|
+
while (isHexDigit(input.next))
|
|
302
|
+
input.advance();
|
|
303
|
+
if (quoted && input.next === 39)
|
|
304
|
+
input.advance();
|
|
305
|
+
input.acceptToken(grammar_sql_terms_1.Number);
|
|
306
|
+
}
|
|
307
|
+
else if (next === 46 && input.next >= 48 && input.next <= 57) {
|
|
308
|
+
readNumber(input, true);
|
|
309
|
+
input.acceptToken(grammar_sql_terms_1.Number);
|
|
310
|
+
}
|
|
311
|
+
else if (next === 46) {
|
|
312
|
+
input.acceptToken(grammar_sql_terms_1.Dot);
|
|
313
|
+
}
|
|
314
|
+
else if (next >= 48 && next <= 57) {
|
|
315
|
+
readNumber(input, false);
|
|
316
|
+
input.acceptToken(grammar_sql_terms_1.Number);
|
|
317
|
+
}
|
|
318
|
+
else if (inString(next, d.operatorChars)) {
|
|
319
|
+
while (inString(input.next, d.operatorChars))
|
|
320
|
+
input.advance();
|
|
321
|
+
input.acceptToken(grammar_sql_terms_1.Operator);
|
|
322
|
+
}
|
|
323
|
+
else if (inString(next, d.specialVar)) {
|
|
324
|
+
if (input.next === next)
|
|
325
|
+
input.advance();
|
|
326
|
+
readWordOrQuoted(input);
|
|
327
|
+
input.acceptToken(grammar_sql_terms_1.SpecialVar);
|
|
328
|
+
}
|
|
329
|
+
else if (inString(next, d.identifierQuotes)) {
|
|
330
|
+
readLiteral(input, next, false);
|
|
331
|
+
input.acceptToken(grammar_sql_terms_1.QuotedIdentifier);
|
|
332
|
+
}
|
|
333
|
+
else if (next === 58 || next === 44) {
|
|
334
|
+
input.acceptToken(grammar_sql_terms_1.Punctuation);
|
|
335
|
+
}
|
|
336
|
+
else if (isAlpha(next)) {
|
|
337
|
+
const word = readWord(input, String.fromCharCode(next));
|
|
338
|
+
input.acceptToken(input.next === 46 ? grammar_sql_terms_1.Identifier : (d.words[word.toLowerCase()] ?? grammar_sql_terms_1.Identifier));
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
exports.tokens = tokensFor(defaults);
|
|
343
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":";;;AA4NA,0BAiBC;AAED,8BAmIC;AAjXD,kCAA8C;AAE9C,2DA2B6B;AAE7B,IAAW,EA6CV;AA7CD,WAAW,EAAE;IACZ,kCAAY,CAAA;IACZ,8BAAU,CAAA;IACV,0CAAgB,CAAA;IAChB,4BAAS,CAAA;IACT,gCAAW,CAAA;IACX,0CAAgB,CAAA;IAChB,gCAAW,CAAA;IACX,gCAAW,CAAA;IACX,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,8BAAU,CAAA;IACV,4BAAS,CAAA;IACT,0BAAQ,CAAA;IACR,8BAAU,CAAA;IACV,8BAAU,CAAA;IACV,4BAAS,CAAA;IACT,oCAAa,CAAA;IACb,wBAAO,CAAA;IACP,oCAAa,CAAA;IACb,oCAAa,CAAA;IACb,sCAAc,CAAA;IACd,wCAAe,CAAA;IACf,oCAAa,CAAA;IACb,iCAAY,CAAA;IACZ,i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AE,CAAC,IAAI,8BAAU,CAAC,CAChF,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAEY,QAAA,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
2
|
+
import { baseConfig } from '@n8n/eslint-config/base';
|
|
3
|
+
|
|
4
|
+
export default defineConfig(baseConfig, globalIgnores(['src/grammar*.ts']), {
|
|
5
|
+
rules: {
|
|
6
|
+
'@typescript-eslint/naming-convention': 'warn',
|
|
7
|
+
'no-useless-escape': 'warn',
|
|
8
|
+
'@typescript-eslint/unbound-method': 'warn',
|
|
9
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
|
|
10
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
|
|
11
|
+
'@typescript-eslint/naming-convention': 'off',
|
|
12
|
+
},
|
|
13
|
+
});
|
package/jest.config.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atom8n/codemirror-lang-sql",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "SQL + n8n expression language support for CodeMirror 6",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"clean": "rimraf dist .turbo",
|
|
7
|
+
"test": "jest",
|
|
8
|
+
"generate:sql:grammar": "lezer-generator --typeScript --output src/grammar.sql.ts src/sql.grammar",
|
|
9
|
+
"generate": "pnpm generate:sql:grammar && pnpm format",
|
|
10
|
+
"build": "tsc -p tsconfig.build.json",
|
|
11
|
+
"test:unit": "jest",
|
|
12
|
+
"lint": "eslint . --quiet",
|
|
13
|
+
"lint:fix": "eslint . --fix",
|
|
14
|
+
"format": "biome format --write src test",
|
|
15
|
+
"format:check": "biome ci src test",
|
|
16
|
+
"typecheck": "tsc --noEmit"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"editor",
|
|
20
|
+
"code"
|
|
21
|
+
],
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "Iván Ovejero",
|
|
24
|
+
"email": "ivov.src@gmail.com",
|
|
25
|
+
"url": "https://ivov.dev"
|
|
26
|
+
},
|
|
27
|
+
"main": "dist/index.js",
|
|
28
|
+
"module": "src/index.ts",
|
|
29
|
+
"types": "dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"require": "./dist/index.js",
|
|
33
|
+
"import": "./src/index.ts",
|
|
34
|
+
"types": "./dist/index.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./*": "./*"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@codemirror/autocomplete": "^6.0.0",
|
|
42
|
+
"@codemirror/language": "^6.0.0",
|
|
43
|
+
"@codemirror/state": "^6.0.0",
|
|
44
|
+
"@lezer/highlight": "^1.0.0",
|
|
45
|
+
"@lezer/lr": "^1.0.0",
|
|
46
|
+
"@n8n/codemirror-lang": "*"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@codemirror/text": "^0.19.6",
|
|
50
|
+
"@lezer/generator": "^1.7.0",
|
|
51
|
+
"@atom8n/typescript-config": "1.3.0"
|
|
52
|
+
}
|
|
53
|
+
}
|