ts-wasms 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -9
- package/index.d.ts +102 -0
- package/index.js +27 -0
- package/out/angular/folds.scm +1 -0
- package/out/angular/highlights.scm +178 -0
- package/out/angular/indents.scm +16 -0
- package/out/angular/injections.scm +1 -0
- package/out/angular/locals.scm +1 -0
- package/out/angular/tree-sitter-angular.wasm +0 -0
- package/out/asm/highlights.scm +66 -0
- package/out/asm/injections.scm +5 -0
- package/out/asm/tree-sitter-asm.wasm +0 -0
- package/out/astro/folds.scm +1 -0
- package/out/astro/highlights.scm +12 -0
- package/out/astro/indents.scm +1 -0
- package/out/astro/injections.scm +27 -0
- package/out/astro/locals.scm +1 -0
- package/out/astro/tree-sitter-astro.wasm +0 -0
- package/out/bash/folds.scm +9 -0
- package/out/bash/indents.scm +32 -0
- package/out/bash/injections.scm +90 -0
- package/out/bash/locals.scm +14 -0
- package/out/c/folds.scm +23 -0
- package/out/c/indents.scm +99 -0
- package/out/c/injections.scm +128 -0
- package/out/c/locals.scm +67 -0
- package/out/clojure/folds.scm +2 -0
- package/out/clojure/injections.scm +2 -0
- package/out/clojure/locals.scm +1 -0
- package/out/cmake/folds.scm +8 -0
- package/out/cmake/highlights.scm +221 -0
- package/out/cmake/indents.scm +26 -0
- package/out/cmake/injections.scm +5 -0
- package/out/cmake/tree-sitter-cmake.wasm +0 -0
- package/out/comment/highlights.scm +49 -0
- package/out/comment/tree-sitter-comment.wasm +0 -0
- package/out/commonlisp/folds.scm +2 -0
- package/out/commonlisp/injections.scm +5 -0
- package/out/commonlisp/locals.scm +109 -0
- package/out/cpp/folds.scm +14 -0
- package/out/cpp/indents.scm +8 -0
- package/out/cpp/locals.scm +78 -0
- package/out/css/folds.scm +10 -0
- package/out/css/indents.scm +11 -0
- package/out/css/injections.scm +2 -0
- package/out/csv/highlights.scm +5 -0
- package/out/csv/tree-sitter-csv.wasm +0 -0
- package/out/csv-psv/highlights.scm +5 -0
- package/out/csv-psv/tree-sitter-csv-psv.wasm +0 -0
- package/out/csv-tsv/highlights.scm +4 -0
- package/out/csv-tsv/tree-sitter-csv-tsv.wasm +0 -0
- package/out/dart/indents.scm +49 -0
- package/out/dart/injections.scm +2 -0
- package/out/dart/locals.scm +32 -0
- package/out/diff/folds.scm +5 -0
- package/out/diff/highlights.scm +49 -0
- package/out/diff/injections.scm +2 -0
- package/out/diff/tree-sitter-diff.wasm +0 -0
- package/out/dockerfile/highlights.scm +58 -0
- package/out/dockerfile/injections.scm +12 -0
- package/out/dockerfile/tree-sitter-dockerfile.wasm +0 -0
- package/out/dtd/folds.scm +4 -0
- package/out/dtd/injections.scm +2 -0
- package/out/dtd/locals.scm +11 -0
- package/out/editorconfig/folds.scm +1 -0
- package/out/editorconfig/highlights.scm +35 -0
- package/out/editorconfig/injections.scm +2 -0
- package/out/editorconfig/tree-sitter-editorconfig.wasm +0 -0
- package/out/elixir/folds.scm +10 -0
- package/out/elixir/indents.scm +25 -0
- package/out/elixir/locals.scm +200 -0
- package/out/elm/folds.scm +14 -0
- package/out/erlang/folds.scm +9 -0
- package/out/erlang/injections.scm +2 -0
- package/out/fish/folds.scm +8 -0
- package/out/fish/highlights.scm +61 -0
- package/out/fish/indents.scm +18 -0
- package/out/fish/injections.scm +2 -0
- package/out/fish/locals.scm +19 -0
- package/out/fish/tree-sitter-fish.wasm +0 -0
- package/out/gdscript/folds.scm +26 -0
- package/out/gdscript/highlights.scm +635 -0
- package/out/gdscript/indents.scm +78 -0
- package/out/gdscript/injections.scm +2 -0
- package/out/gdscript/locals.scm +121 -0
- package/out/gdscript/tree-sitter-gdscript.wasm +0 -0
- package/out/gdshader/highlights.scm +256 -0
- package/out/gdshader/injections.scm +2 -0
- package/out/gdshader/locals.scm +24 -0
- package/out/gdshader/tags.scm +13 -0
- package/out/gdshader/tree-sitter-gdshader.wasm +0 -0
- package/out/git-config/highlights.scm +28 -0
- package/out/git-config/tree-sitter-git-config.wasm +0 -0
- package/out/git-rebase/highlights.scm +36 -0
- package/out/git-rebase/tree-sitter-git-rebase.wasm +0 -0
- package/out/gitattributes/highlights.scm +52 -0
- package/out/gitattributes/injections.scm +2 -0
- package/out/gitattributes/locals.scm +8 -0
- package/out/gitattributes/tree-sitter-gitattributes.wasm +0 -0
- package/out/gitignore/highlights.scm +36 -0
- package/out/gitignore/injections.scm +2 -0
- package/out/gitignore/tree-sitter-gitignore.wasm +0 -0
- package/out/go/folds.scm +19 -0
- package/out/go/indents.scm +48 -0
- package/out/go/injections.scm +42 -0
- package/out/go/locals.scm +88 -0
- package/out/godot-resource/tree-sitter-godot-resource.wasm +0 -0
- package/out/graphql/indents.scm +11 -0
- package/out/graphql/injections.scm +2 -0
- package/out/groovy/folds.scm +6 -0
- package/out/groovy/highlights.scm +148 -0
- package/out/groovy/indents.scm +23 -0
- package/out/groovy/injections.scm +5 -0
- package/out/groovy/locals.scm +6 -0
- package/out/groovy/tree-sitter-groovy.wasm +0 -0
- package/out/haskell/folds.scm +6 -0
- package/out/hcl/folds.scm +6 -0
- package/out/hcl/indents.scm +16 -0
- package/out/hcl/injections.scm +6 -0
- package/out/html/folds.scm +5 -0
- package/out/html/indents.scm +1 -0
- package/out/html/locals.scm +1 -0
- package/out/ini/folds.scm +1 -0
- package/out/ini/highlights.scm +16 -0
- package/out/ini/injections.scm +3 -0
- package/out/ini/tree-sitter-ini.wasm +0 -0
- package/out/java/folds.scm +8 -0
- package/out/java/indents.scm +40 -0
- package/out/java/injections.scm +31 -0
- package/out/java/locals.scm +100 -0
- package/out/javascript/folds.scm +1 -0
- package/out/javascript/indents.scm +1 -0
- package/out/json/folds.scm +5 -0
- package/out/json/indents.scm +11 -0
- package/out/json/injections.scm +2 -0
- package/out/json/locals.scm +4 -0
- package/out/julia/folds.scm +14 -0
- package/out/julia/indents.scm +52 -0
- package/out/kotlin/folds.scm +13 -0
- package/out/kotlin/injections.scm +52 -0
- package/out/kotlin/locals.scm +78 -0
- package/out/lua/folds.scm +12 -0
- package/out/lua/indents.scm +47 -0
- package/out/markdown/folds.scm +12 -0
- package/out/markdown/indents.scm +1 -0
- package/out/matlab/folds.scm +13 -0
- package/out/matlab/highlights.scm +218 -0
- package/out/matlab/indents.scm +40 -0
- package/out/matlab/injections.scm +2 -0
- package/out/matlab/locals.scm +33 -0
- package/out/matlab/tree-sitter-matlab.wasm +0 -0
- package/out/nim/folds.scm +41 -0
- package/out/nim/highlights.scm +186 -0
- package/out/nim/injections.scm +79 -0
- package/out/nim/locals.scm +328 -0
- package/out/nim/tree-sitter-nim.wasm +0 -0
- package/out/nix/folds.scm +11 -0
- package/out/nix/indents.scm +75 -0
- package/out/ocaml/folds.scm +30 -0
- package/out/ocaml/indents.scm +77 -0
- package/out/ocaml/injections.scm +2 -0
- package/out/php/folds.scm +1 -0
- package/out/php/indents.scm +1 -0
- package/out/php/locals.scm +1 -0
- package/out/prisma/folds.scm +7 -0
- package/out/prisma/injections.scm +5 -0
- package/out/python/folds.scm +28 -0
- package/out/python/indents.scm +213 -0
- package/out/python/injections.scm +30 -0
- package/out/python/locals.scm +124 -0
- package/out/qmljs/folds.scm +8 -0
- package/out/qmljs/highlights.scm +61 -0
- package/out/qmljs/injections.scm +1 -0
- package/out/qmljs/locals.scm +6 -0
- package/out/qmljs/tree-sitter-qmljs.wasm +0 -0
- package/out/query/folds.scm +6 -0
- package/out/query/indents.scm +25 -0
- package/out/query/injections.scm +28 -0
- package/out/query/locals.scm +21 -0
- package/out/r/indents.scm +33 -0
- package/out/r/injections.scm +2 -0
- package/out/racket/folds.scm +2 -0
- package/out/racket/injections.scm +5 -0
- package/out/ruby/folds.scm +12 -0
- package/out/ruby/indents.scm +43 -0
- package/out/ruby/injections.scm +34 -0
- package/out/rust/folds.scm +25 -0
- package/out/rust/indents.scm +133 -0
- package/out/rust/locals.scm +98 -0
- package/out/scala/folds.scm +16 -0
- package/out/scala/injections.scm +5 -0
- package/out/scheme/folds.scm +2 -0
- package/out/scheme/injections.scm +2 -0
- package/out/scss/folds.scm +1 -0
- package/out/scss/indents.scm +7 -0
- package/out/scss/injections.scm +2 -0
- package/out/sql/folds.scm +1 -0
- package/out/sql/injections.scm +5 -0
- package/out/terraform/folds.scm +1 -0
- package/out/terraform/indents.scm +1 -0
- package/out/terraform/injections.scm +1 -0
- package/out/toml/folds.scm +5 -0
- package/out/toml/indents.scm +11 -0
- package/out/toml/injections.scm +2 -0
- package/out/toml/locals.scm +4 -0
- package/out/tsx/folds.scm +1 -0
- package/out/tsx/indents.scm +1 -0
- package/out/tsx/injections.scm +1 -0
- package/out/typescript/folds.scm +8 -0
- package/out/typescript/indents.scm +7 -0
- package/out/typescript/injections.scm +28 -0
- package/out/vim/folds.scm +4 -0
- package/out/vim/highlights.scm +362 -0
- package/out/vim/injections.scm +44 -0
- package/out/vim/locals.scm +19 -0
- package/out/vim/tree-sitter-vim.wasm +0 -0
- package/out/vimdoc/injections.scm +4 -0
- package/out/vue/folds.scm +6 -0
- package/out/vue/highlights.scm +54 -0
- package/out/vue/indents.scm +7 -0
- package/out/vue/injections.scm +78 -0
- package/out/vue/tree-sitter-vue.wasm +0 -0
- package/out/xml/folds.scm +5 -0
- package/out/xml/indents.scm +16 -0
- package/out/xml/injections.scm +32 -0
- package/out/xml/locals.scm +35 -0
- package/out/yaml/folds.scm +4 -0
- package/out/yaml/highlights.scm +79 -0
- package/out/yaml/indents.scm +7 -0
- package/out/yaml/injections.scm +81 -0
- package/out/yaml/locals.scm +9 -0
- package/out/yaml/tree-sitter-yaml.wasm +0 -0
- package/out/zig/locals.scm +96 -0
- package/package.json +49 -17
package/README.md
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
# ts-wasms
|
|
2
|
-
Prebuilt WASM binaries for tree-sitter's language parsers.
|
|
3
|
-
You can find a list of supported
|
|
1
|
+
# ts-wasms [](https://www.npmjs.com/package/ts-wasms)
|
|
2
|
+
Prebuilt WASM binaries and query files(`.scm`) for tree-sitter's language parsers.
|
|
3
|
+
You can find a list of supported languages [here](https://app.unpkg.com/ts-wasms/files/out)
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
```bash
|
|
7
|
+
npm install ts-wasms
|
|
8
|
+
# or
|
|
7
9
|
pnpm add ts-wasms
|
|
10
|
+
# or
|
|
11
|
+
yarn add ts-wasms
|
|
12
|
+
# or
|
|
13
|
+
bun install ts-wasms
|
|
8
14
|
```
|
|
9
15
|
|
|
10
16
|
## Usage
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import
|
|
17
|
+
A type-safe API is provided for accessing grammars and queries at runtime
|
|
18
|
+
```typescript
|
|
19
|
+
import { getWasmPath, getQueryPath } from "ts-wasms";
|
|
20
|
+
|
|
21
|
+
const wasmPath = getWasmPath("python");
|
|
22
|
+
const queryPath = getQueryPath("python", "highlights");
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
You can also import the assets directly via your bundler
|
|
26
|
+
```typescript
|
|
27
|
+
import wasmUrl from "ts-wasms/python/tree-sitter-python.wasm?url";
|
|
28
|
+
import wasmHighlights from "ts-wasms/python/highlights.scm?raw";
|
|
14
29
|
```
|
|
15
30
|
|
|
16
31
|
Each language directory includes a `tree-sitter-<lang>.wasm` file but may also include:
|
|
@@ -22,12 +37,14 @@ Each language directory includes a `tree-sitter-<lang>.wasm` file but may also i
|
|
|
22
37
|
- `indents.scm`
|
|
23
38
|
|
|
24
39
|
```txt
|
|
25
|
-
|
|
40
|
+
python/
|
|
26
41
|
├── tree-sitter-python.wasm
|
|
27
42
|
├── highlights.scm
|
|
28
43
|
└── tags.scm
|
|
29
44
|
```
|
|
30
45
|
|
|
31
46
|
## Licenses
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
The licenses for the generated .wasm and .scm files belong to their respective upstream grammar authors and can be found on their github repos.
|
|
48
|
+
|
|
49
|
+
The code in this repository is licensed under MIT.
|
|
50
|
+
If you maintain an upstream grammar and have a problem with this licensing, please open an issue.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/** Standard Tree-sitter query categories */
|
|
2
|
+
export type TreeSitterQuery =
|
|
3
|
+
| "highlights"
|
|
4
|
+
| "injections"
|
|
5
|
+
| "locals"
|
|
6
|
+
| "tags"
|
|
7
|
+
| "folds"
|
|
8
|
+
| "indents";
|
|
9
|
+
|
|
10
|
+
/** Supported language identifiers compiled during build step */
|
|
11
|
+
export type SupportedLanguage =
|
|
12
|
+
| "angular"
|
|
13
|
+
| "asm"
|
|
14
|
+
| "astro"
|
|
15
|
+
| "bash"
|
|
16
|
+
| "c"
|
|
17
|
+
| "c-sharp"
|
|
18
|
+
| "clojure"
|
|
19
|
+
| "cmake"
|
|
20
|
+
| "comment"
|
|
21
|
+
| "commonlisp"
|
|
22
|
+
| "cpp"
|
|
23
|
+
| "css"
|
|
24
|
+
| "csv"
|
|
25
|
+
| "csv-psv"
|
|
26
|
+
| "csv-tsv"
|
|
27
|
+
| "dart"
|
|
28
|
+
| "diff"
|
|
29
|
+
| "dockerfile"
|
|
30
|
+
| "dtd"
|
|
31
|
+
| "editorconfig"
|
|
32
|
+
| "elisp"
|
|
33
|
+
| "elixir"
|
|
34
|
+
| "elm"
|
|
35
|
+
| "embedded-template"
|
|
36
|
+
| "erlang"
|
|
37
|
+
| "fish"
|
|
38
|
+
| "gdscript"
|
|
39
|
+
| "gdshader"
|
|
40
|
+
| "git-config"
|
|
41
|
+
| "git-rebase"
|
|
42
|
+
| "gitattributes"
|
|
43
|
+
| "gitignore"
|
|
44
|
+
| "go"
|
|
45
|
+
| "godot-resource"
|
|
46
|
+
| "graphql"
|
|
47
|
+
| "groovy"
|
|
48
|
+
| "haskell"
|
|
49
|
+
| "hcl"
|
|
50
|
+
| "html"
|
|
51
|
+
| "ini"
|
|
52
|
+
| "java"
|
|
53
|
+
| "javascript"
|
|
54
|
+
| "json"
|
|
55
|
+
| "julia"
|
|
56
|
+
| "kotlin"
|
|
57
|
+
| "lua"
|
|
58
|
+
| "markdown"
|
|
59
|
+
| "markdown-inline"
|
|
60
|
+
| "matlab"
|
|
61
|
+
| "nim"
|
|
62
|
+
| "nix"
|
|
63
|
+
| "objc"
|
|
64
|
+
| "ocaml"
|
|
65
|
+
| "ocaml-interface"
|
|
66
|
+
| "ocaml-type"
|
|
67
|
+
| "perl"
|
|
68
|
+
| "php"
|
|
69
|
+
| "php-only"
|
|
70
|
+
| "prisma"
|
|
71
|
+
| "python"
|
|
72
|
+
| "qmljs"
|
|
73
|
+
| "query"
|
|
74
|
+
| "r"
|
|
75
|
+
| "racket"
|
|
76
|
+
| "regex"
|
|
77
|
+
| "ruby"
|
|
78
|
+
| "rust"
|
|
79
|
+
| "scala"
|
|
80
|
+
| "scheme"
|
|
81
|
+
| "scss"
|
|
82
|
+
| "sql"
|
|
83
|
+
| "swift"
|
|
84
|
+
| "terraform"
|
|
85
|
+
| "toml"
|
|
86
|
+
| "tsx"
|
|
87
|
+
| "typescript"
|
|
88
|
+
| "vim"
|
|
89
|
+
| "vimdoc"
|
|
90
|
+
| "vue"
|
|
91
|
+
| "xml"
|
|
92
|
+
| "yaml"
|
|
93
|
+
| "zig";
|
|
94
|
+
|
|
95
|
+
/** Resolves the absolute path to a specific language's WASM file. */
|
|
96
|
+
export declare function getWasmPath(lang: SupportedLanguage): string;
|
|
97
|
+
|
|
98
|
+
/** Resolves the absolute path to a specific language's query file. */
|
|
99
|
+
export declare function getQueryPath(
|
|
100
|
+
lang: SupportedLanguage,
|
|
101
|
+
query: TreeSitterQuery,
|
|
102
|
+
): string;
|
package/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the absolute path to a specific language's WASM file.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} lang
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
9
|
+
export function getWasmPath(lang) {
|
|
10
|
+
const url = new URL(
|
|
11
|
+
`./out/${lang}/tree-sitter-${lang}.wasm`,
|
|
12
|
+
import.meta.url,
|
|
13
|
+
);
|
|
14
|
+
return fileURLToPath(url);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the absolute path to a specific language's query file.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} lang
|
|
21
|
+
* @param {string} query
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export function getQueryPath(lang, query) {
|
|
25
|
+
const url = new URL(`./out/${lang}/${query}.scm`, import.meta.url);
|
|
26
|
+
return fileURLToPath(url);
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: html
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
; inherits: html
|
|
2
|
+
|
|
3
|
+
(identifier) @variable
|
|
4
|
+
|
|
5
|
+
(style_unit) @variable
|
|
6
|
+
|
|
7
|
+
(pipe_operator) @operator
|
|
8
|
+
|
|
9
|
+
(string) @string
|
|
10
|
+
|
|
11
|
+
(number) @number
|
|
12
|
+
|
|
13
|
+
(pipe_call
|
|
14
|
+
name: (identifier) @function)
|
|
15
|
+
|
|
16
|
+
(pipe_call
|
|
17
|
+
arguments: (pipe_arguments
|
|
18
|
+
(identifier) @variable.parameter))
|
|
19
|
+
|
|
20
|
+
(structural_directive
|
|
21
|
+
"*" @keyword
|
|
22
|
+
(identifier) @keyword)
|
|
23
|
+
|
|
24
|
+
(attribute
|
|
25
|
+
(attribute_name) @variable.member
|
|
26
|
+
(#lua-match? @variable.member "#.*"))
|
|
27
|
+
|
|
28
|
+
(binding_name
|
|
29
|
+
(identifier) @keyword)
|
|
30
|
+
|
|
31
|
+
(class_binding
|
|
32
|
+
[
|
|
33
|
+
(identifier)
|
|
34
|
+
(class_name)
|
|
35
|
+
] @keyword)
|
|
36
|
+
|
|
37
|
+
(event_binding
|
|
38
|
+
(binding_name
|
|
39
|
+
(identifier) @keyword))
|
|
40
|
+
|
|
41
|
+
(event_binding
|
|
42
|
+
"\"" @punctuation.delimiter)
|
|
43
|
+
|
|
44
|
+
(property_binding
|
|
45
|
+
[
|
|
46
|
+
"\""
|
|
47
|
+
"\"\""
|
|
48
|
+
] @punctuation.delimiter)
|
|
49
|
+
|
|
50
|
+
(structural_assignment
|
|
51
|
+
operator: (identifier) @keyword)
|
|
52
|
+
|
|
53
|
+
(member_expression
|
|
54
|
+
property: (identifier) @property)
|
|
55
|
+
|
|
56
|
+
(call_expression
|
|
57
|
+
function: (identifier) @function)
|
|
58
|
+
|
|
59
|
+
(call_expression
|
|
60
|
+
function: ((identifier) @function.builtin
|
|
61
|
+
(#eq? @function.builtin "$any")))
|
|
62
|
+
|
|
63
|
+
(pair
|
|
64
|
+
key: ((identifier) @variable.builtin
|
|
65
|
+
(#eq? @variable.builtin "$implicit")))
|
|
66
|
+
|
|
67
|
+
[
|
|
68
|
+
(control_keyword)
|
|
69
|
+
(special_keyword)
|
|
70
|
+
] @keyword
|
|
71
|
+
|
|
72
|
+
((control_keyword) @keyword.repeat
|
|
73
|
+
(#any-of? @keyword.repeat "for" "empty"))
|
|
74
|
+
|
|
75
|
+
((control_keyword) @keyword.conditional
|
|
76
|
+
(#any-of? @keyword.conditional "if" "else" "switch" "case" "default"))
|
|
77
|
+
|
|
78
|
+
((control_keyword) @keyword.coroutine
|
|
79
|
+
(#any-of? @keyword.coroutine "defer" "placeholder" "loading"))
|
|
80
|
+
|
|
81
|
+
((control_keyword) @keyword.exception
|
|
82
|
+
(#eq? @keyword.exception "error"))
|
|
83
|
+
|
|
84
|
+
((identifier) @boolean
|
|
85
|
+
(#any-of? @boolean "true" "false"))
|
|
86
|
+
|
|
87
|
+
((identifier) @variable.builtin
|
|
88
|
+
(#any-of? @variable.builtin "this" "$event"))
|
|
89
|
+
|
|
90
|
+
((identifier) @constant.builtin
|
|
91
|
+
(#eq? @constant.builtin "null"))
|
|
92
|
+
|
|
93
|
+
[
|
|
94
|
+
(ternary_operator)
|
|
95
|
+
(conditional_operator)
|
|
96
|
+
] @keyword.conditional.ternary
|
|
97
|
+
|
|
98
|
+
[
|
|
99
|
+
"("
|
|
100
|
+
")"
|
|
101
|
+
"["
|
|
102
|
+
"]"
|
|
103
|
+
"{"
|
|
104
|
+
"}"
|
|
105
|
+
"@"
|
|
106
|
+
] @punctuation.bracket
|
|
107
|
+
|
|
108
|
+
(two_way_binding
|
|
109
|
+
[
|
|
110
|
+
"[("
|
|
111
|
+
")]"
|
|
112
|
+
] @punctuation.bracket)
|
|
113
|
+
|
|
114
|
+
[
|
|
115
|
+
"{{"
|
|
116
|
+
"}}"
|
|
117
|
+
] @punctuation.special
|
|
118
|
+
|
|
119
|
+
(template_substitution
|
|
120
|
+
[
|
|
121
|
+
"${"
|
|
122
|
+
"}"
|
|
123
|
+
] @punctuation.special)
|
|
124
|
+
|
|
125
|
+
(template_chars) @string
|
|
126
|
+
|
|
127
|
+
[
|
|
128
|
+
";"
|
|
129
|
+
"."
|
|
130
|
+
","
|
|
131
|
+
"?."
|
|
132
|
+
"!."
|
|
133
|
+
] @punctuation.delimiter
|
|
134
|
+
|
|
135
|
+
(nullish_coalescing_expression
|
|
136
|
+
(coalescing_operator) @operator)
|
|
137
|
+
|
|
138
|
+
(concatenation_expression
|
|
139
|
+
"+" @operator)
|
|
140
|
+
|
|
141
|
+
(icu_clause) @keyword.operator
|
|
142
|
+
|
|
143
|
+
(icu_category) @keyword.conditional
|
|
144
|
+
|
|
145
|
+
(binary_expression
|
|
146
|
+
[
|
|
147
|
+
"-"
|
|
148
|
+
"&&"
|
|
149
|
+
"+"
|
|
150
|
+
"<"
|
|
151
|
+
"<="
|
|
152
|
+
"="
|
|
153
|
+
"=="
|
|
154
|
+
"==="
|
|
155
|
+
"!="
|
|
156
|
+
"!=="
|
|
157
|
+
">"
|
|
158
|
+
">="
|
|
159
|
+
"*"
|
|
160
|
+
"/"
|
|
161
|
+
"||"
|
|
162
|
+
"%"
|
|
163
|
+
] @operator)
|
|
164
|
+
|
|
165
|
+
(arrow_function
|
|
166
|
+
"=>" @operator)
|
|
167
|
+
|
|
168
|
+
(object
|
|
169
|
+
(spread
|
|
170
|
+
"..." @operator))
|
|
171
|
+
|
|
172
|
+
(array
|
|
173
|
+
(spread
|
|
174
|
+
"..." @operator))
|
|
175
|
+
|
|
176
|
+
(arguments
|
|
177
|
+
(spread
|
|
178
|
+
"..." @operator))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: html
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: html
|
|
Binary file
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
; General
|
|
2
|
+
(label
|
|
3
|
+
[
|
|
4
|
+
(ident)
|
|
5
|
+
(word)
|
|
6
|
+
] @label)
|
|
7
|
+
|
|
8
|
+
(reg) @variable.builtin
|
|
9
|
+
|
|
10
|
+
(meta
|
|
11
|
+
kind: (_) @function.builtin)
|
|
12
|
+
|
|
13
|
+
(instruction
|
|
14
|
+
kind: (_) @function.builtin)
|
|
15
|
+
|
|
16
|
+
(const
|
|
17
|
+
name: (word) @constant)
|
|
18
|
+
|
|
19
|
+
; Comments
|
|
20
|
+
[
|
|
21
|
+
(line_comment)
|
|
22
|
+
(block_comment)
|
|
23
|
+
] @comment @spell
|
|
24
|
+
|
|
25
|
+
; Literals
|
|
26
|
+
(int) @number
|
|
27
|
+
|
|
28
|
+
(float) @number.float
|
|
29
|
+
|
|
30
|
+
(string) @string
|
|
31
|
+
|
|
32
|
+
; Keywords
|
|
33
|
+
[
|
|
34
|
+
"byte"
|
|
35
|
+
"word"
|
|
36
|
+
"dword"
|
|
37
|
+
"qword"
|
|
38
|
+
"ptr"
|
|
39
|
+
"rel"
|
|
40
|
+
"label"
|
|
41
|
+
"const"
|
|
42
|
+
] @keyword
|
|
43
|
+
|
|
44
|
+
; Operators & Punctuation
|
|
45
|
+
[
|
|
46
|
+
"+"
|
|
47
|
+
"-"
|
|
48
|
+
"*"
|
|
49
|
+
"/"
|
|
50
|
+
"%"
|
|
51
|
+
"|"
|
|
52
|
+
"^"
|
|
53
|
+
"&"
|
|
54
|
+
] @operator
|
|
55
|
+
|
|
56
|
+
[
|
|
57
|
+
"("
|
|
58
|
+
")"
|
|
59
|
+
"["
|
|
60
|
+
"]"
|
|
61
|
+
] @punctuation.bracket
|
|
62
|
+
|
|
63
|
+
[
|
|
64
|
+
","
|
|
65
|
+
":"
|
|
66
|
+
] @punctuation.delimiter
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: html
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: html
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
(frontmatter
|
|
2
|
+
(frontmatter_js_block) @injection.content
|
|
3
|
+
(#set! injection.language "typescript"))
|
|
4
|
+
|
|
5
|
+
(attribute_interpolation
|
|
6
|
+
(attribute_js_expr) @injection.content
|
|
7
|
+
(#set! injection.language "typescript"))
|
|
8
|
+
|
|
9
|
+
; TODO proper queries for html_interpolation highlighting
|
|
10
|
+
(html_interpolation
|
|
11
|
+
(permissible_text) @injection.content
|
|
12
|
+
(#set! injection.language "typescript"))
|
|
13
|
+
|
|
14
|
+
(script_element
|
|
15
|
+
(raw_text) @injection.content
|
|
16
|
+
(#set! injection.language "typescript"))
|
|
17
|
+
|
|
18
|
+
(style_element
|
|
19
|
+
(start_tag
|
|
20
|
+
(attribute
|
|
21
|
+
(attribute_name) @_lang_attr
|
|
22
|
+
(quoted_attribute_value
|
|
23
|
+
(attribute_value) @_lang_value)))
|
|
24
|
+
(raw_text) @injection.content
|
|
25
|
+
(#eq? @_lang_attr "lang")
|
|
26
|
+
(#eq? @_lang_value "scss")
|
|
27
|
+
(#set! injection.language "scss"))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: html
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[
|
|
2
|
+
(if_statement)
|
|
3
|
+
(for_statement)
|
|
4
|
+
(while_statement)
|
|
5
|
+
(case_statement)
|
|
6
|
+
(function_definition)
|
|
7
|
+
(compound_statement)
|
|
8
|
+
(subshell)
|
|
9
|
+
(command_substitution)
|
|
10
|
+
(do_group)
|
|
11
|
+
(case_item)
|
|
12
|
+
] @indent.begin
|
|
13
|
+
|
|
14
|
+
[
|
|
15
|
+
"fi"
|
|
16
|
+
"done"
|
|
17
|
+
"esac"
|
|
18
|
+
"}"
|
|
19
|
+
")"
|
|
20
|
+
"then"
|
|
21
|
+
"do"
|
|
22
|
+
(elif_clause)
|
|
23
|
+
(else_clause)
|
|
24
|
+
] @indent.branch
|
|
25
|
+
|
|
26
|
+
[
|
|
27
|
+
"fi"
|
|
28
|
+
"done"
|
|
29
|
+
"esac"
|
|
30
|
+
"}"
|
|
31
|
+
")"
|
|
32
|
+
] @indent.end
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
((comment) @injection.content
|
|
2
|
+
(#set! injection.language "comment"))
|
|
3
|
+
|
|
4
|
+
((regex) @injection.content
|
|
5
|
+
(#set! injection.language "regex"))
|
|
6
|
+
|
|
7
|
+
(heredoc_redirect
|
|
8
|
+
(heredoc_body) @injection.content
|
|
9
|
+
(heredoc_end) @injection.language)
|
|
10
|
+
|
|
11
|
+
; printf 'format'
|
|
12
|
+
((command
|
|
13
|
+
name: (command_name) @_command
|
|
14
|
+
.
|
|
15
|
+
argument: [
|
|
16
|
+
(string) @injection.content
|
|
17
|
+
(concatenation
|
|
18
|
+
(string) @injection.content)
|
|
19
|
+
(raw_string) @injection.content
|
|
20
|
+
(concatenation
|
|
21
|
+
(raw_string) @injection.content)
|
|
22
|
+
])
|
|
23
|
+
(#eq? @_command "printf")
|
|
24
|
+
(#offset! @injection.content 0 1 0 -1)
|
|
25
|
+
(#set! injection.include-children)
|
|
26
|
+
(#set! injection.language "printf"))
|
|
27
|
+
|
|
28
|
+
; printf -v var 'format'
|
|
29
|
+
((command
|
|
30
|
+
name: (command_name) @_command
|
|
31
|
+
argument: (word) @_arg
|
|
32
|
+
.
|
|
33
|
+
(_)
|
|
34
|
+
.
|
|
35
|
+
argument: [
|
|
36
|
+
(string) @injection.content
|
|
37
|
+
(concatenation
|
|
38
|
+
(string) @injection.content)
|
|
39
|
+
(raw_string) @injection.content
|
|
40
|
+
(concatenation
|
|
41
|
+
(raw_string) @injection.content)
|
|
42
|
+
])
|
|
43
|
+
(#eq? @_command "printf")
|
|
44
|
+
(#eq? @_arg "-v")
|
|
45
|
+
(#offset! @injection.content 0 1 0 -1)
|
|
46
|
+
(#set! injection.include-children)
|
|
47
|
+
(#set! injection.language "printf"))
|
|
48
|
+
|
|
49
|
+
; printf -- 'format'
|
|
50
|
+
((command
|
|
51
|
+
name: (command_name) @_command
|
|
52
|
+
argument: (word) @_arg
|
|
53
|
+
.
|
|
54
|
+
argument: [
|
|
55
|
+
(string) @injection.content
|
|
56
|
+
(concatenation
|
|
57
|
+
(string) @injection.content)
|
|
58
|
+
(raw_string) @injection.content
|
|
59
|
+
(concatenation
|
|
60
|
+
(raw_string) @injection.content)
|
|
61
|
+
])
|
|
62
|
+
(#eq? @_command "printf")
|
|
63
|
+
(#eq? @_arg "--")
|
|
64
|
+
(#offset! @injection.content 0 1 0 -1)
|
|
65
|
+
(#set! injection.include-children)
|
|
66
|
+
(#set! injection.language "printf"))
|
|
67
|
+
|
|
68
|
+
((command
|
|
69
|
+
name: (command_name) @_command
|
|
70
|
+
.
|
|
71
|
+
argument: [
|
|
72
|
+
(string)
|
|
73
|
+
(raw_string)
|
|
74
|
+
] @injection.content)
|
|
75
|
+
(#eq? @_command "bind")
|
|
76
|
+
(#offset! @injection.content 0 1 0 -1)
|
|
77
|
+
(#set! injection.include-children)
|
|
78
|
+
(#set! injection.language "readline"))
|
|
79
|
+
|
|
80
|
+
((command
|
|
81
|
+
name: (command_name) @_command
|
|
82
|
+
.
|
|
83
|
+
argument: [
|
|
84
|
+
(string)
|
|
85
|
+
(raw_string)
|
|
86
|
+
] @injection.content)
|
|
87
|
+
(#eq? @_command "trap")
|
|
88
|
+
(#offset! @injection.content 0 1 0 -1)
|
|
89
|
+
(#set! injection.include-children)
|
|
90
|
+
(#set! injection.self))
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
; Scopes
|
|
2
|
+
(function_definition) @local.scope
|
|
3
|
+
|
|
4
|
+
; Definitions
|
|
5
|
+
(variable_assignment
|
|
6
|
+
name: (variable_name) @local.definition.var)
|
|
7
|
+
|
|
8
|
+
(function_definition
|
|
9
|
+
name: (word) @local.definition.function)
|
|
10
|
+
|
|
11
|
+
; References
|
|
12
|
+
(variable_name) @local.reference
|
|
13
|
+
|
|
14
|
+
(word) @local.reference
|
package/out/c/folds.scm
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[
|
|
2
|
+
(for_statement)
|
|
3
|
+
(if_statement)
|
|
4
|
+
(while_statement)
|
|
5
|
+
(do_statement)
|
|
6
|
+
(switch_statement)
|
|
7
|
+
(case_statement)
|
|
8
|
+
(function_definition)
|
|
9
|
+
(struct_specifier)
|
|
10
|
+
(enum_specifier)
|
|
11
|
+
(comment)
|
|
12
|
+
(preproc_if)
|
|
13
|
+
(preproc_elif)
|
|
14
|
+
(preproc_else)
|
|
15
|
+
(preproc_ifdef)
|
|
16
|
+
(preproc_function_def)
|
|
17
|
+
(initializer_list)
|
|
18
|
+
(gnu_asm_expression)
|
|
19
|
+
(preproc_include)+
|
|
20
|
+
] @fold
|
|
21
|
+
|
|
22
|
+
(compound_statement
|
|
23
|
+
(compound_statement) @fold)
|