ts-wasms 1.0.3 → 1.0.4

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.
Files changed (64) hide show
  1. package/out/bash/tree-sitter-bash.wasm +0 -0
  2. package/out/c/tree-sitter-c.wasm +0 -0
  3. package/out/cpp/tree-sitter-cpp.wasm +0 -0
  4. package/out/css/tree-sitter-css.wasm +0 -0
  5. package/out/dart/tree-sitter-dart.wasm +0 -0
  6. package/out/elixir/tree-sitter-elixir.wasm +0 -0
  7. package/out/embedded-template/tree-sitter-embedded_template.wasm +0 -0
  8. package/out/go/tree-sitter-go.wasm +0 -0
  9. package/out/haskell/tree-sitter-haskell.wasm +0 -0
  10. package/out/hcl/tree-sitter-hcl.wasm +0 -0
  11. package/out/hcl-terraform/tree-sitter-terraform.wasm +0 -0
  12. package/out/html/tree-sitter-html.wasm +0 -0
  13. package/out/java/tree-sitter-java.wasm +0 -0
  14. package/out/javascript/tree-sitter-javascript.wasm +0 -0
  15. package/out/json/tree-sitter-json.wasm +0 -0
  16. package/out/lua/tree-sitter-lua.wasm +0 -0
  17. package/out/nix/highlights.scm +99 -0
  18. package/out/nix/injections.scm +39 -0
  19. package/out/nix/locals.scm +33 -0
  20. package/out/nix/tags.scm +16 -0
  21. package/out/nix/tree-sitter-nix.wasm +0 -0
  22. package/out/objc/tree-sitter-objc.wasm +0 -0
  23. package/out/ocaml/highlights.scm +148 -0
  24. package/out/ocaml/locals.scm +24 -0
  25. package/out/ocaml/tags.scm +170 -0
  26. package/out/ocaml/tree-sitter-ocaml.wasm +0 -0
  27. package/out/ocaml-interface/highlights.scm +148 -0
  28. package/out/ocaml-interface/locals.scm +24 -0
  29. package/out/ocaml-interface/tags.scm +170 -0
  30. package/out/ocaml-interface/tree-sitter-ocaml_interface.wasm +0 -0
  31. package/out/ocaml-type/highlights.scm +148 -0
  32. package/out/ocaml-type/locals.scm +24 -0
  33. package/out/ocaml-type/tags.scm +170 -0
  34. package/out/ocaml-type/tree-sitter-ocaml_type.wasm +0 -0
  35. package/out/perl/folds.scm +27 -0
  36. package/out/perl/highlights.scm +162 -0
  37. package/out/perl/injections.scm +14 -0
  38. package/out/perl/matchup.scm +30 -0
  39. package/out/perl/tree-sitter-perl.wasm +0 -0
  40. package/out/php/tree-sitter-php.wasm +0 -0
  41. package/out/{php-php_only → php-only}/tree-sitter-php_only.wasm +0 -0
  42. package/out/python/tree-sitter-python.wasm +0 -0
  43. package/out/r/tree-sitter-r.wasm +0 -0
  44. package/out/regex/tree-sitter-regex.wasm +0 -0
  45. package/out/ruby/tree-sitter-ruby.wasm +0 -0
  46. package/out/rust/tree-sitter-rust.wasm +0 -0
  47. package/out/scala/tree-sitter-scala.wasm +0 -0
  48. package/out/scss/highlights.scm +69 -0
  49. package/out/scss/tree-sitter-scss.wasm +0 -0
  50. package/out/toml/tree-sitter-toml.wasm +0 -0
  51. package/out/typescript/tree-sitter-typescript.wasm +0 -0
  52. package/out/typescript-tsx/tree-sitter-tsx.wasm +0 -0
  53. package/out/zig/tree-sitter-zig.wasm +0 -0
  54. package/package.json +4 -1
  55. /package/out/{markdown-tree-sitter-markdown → markdown}/highlights.scm +0 -0
  56. /package/out/{markdown-tree-sitter-markdown → markdown}/injections.scm +0 -0
  57. /package/out/{markdown-tree-sitter-markdown → markdown}/tree-sitter-markdown.wasm +0 -0
  58. /package/out/{markdown-tree-sitter-markdown-inline → markdown-inline}/highlights.scm +0 -0
  59. /package/out/{markdown-tree-sitter-markdown-inline → markdown-inline}/injections.scm +0 -0
  60. /package/out/{markdown-tree-sitter-markdown-inline → markdown-inline}/tree-sitter-markdown_inline.wasm +0 -0
  61. /package/out/{php-php_only → php-only}/highlights.scm +0 -0
  62. /package/out/{php-php_only → php-only}/injections-text.scm +0 -0
  63. /package/out/{php-php_only → php-only}/injections.scm +0 -0
  64. /package/out/{php-php_only → php-only}/tags.scm +0 -0
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,99 @@
1
+ (comment) @comment
2
+
3
+ [
4
+ "if"
5
+ "then"
6
+ "else"
7
+ "let"
8
+ "inherit"
9
+ "in"
10
+ "rec"
11
+ "with"
12
+ "assert"
13
+ "or"
14
+ ] @keyword
15
+
16
+ ((identifier) @variable.builtin
17
+ (#match? @variable.builtin "^(__currentSystem|__currentTime|__langVersion|__nixPath|__nixVersion|__storeDir|builtins|false|null|true)$")
18
+ (#is-not? local))
19
+
20
+ ((identifier) @function.builtin
21
+ (#match? @function.builtin "^(__add|__addErrorContext|__all|__any|__appendContext|__attrNames|__attrValues|__bitAnd|__bitOr|__bitXor|__catAttrs|__ceil|__compareVersions|__concatLists|__concatMap|__concatStringsSep|__deepSeq|__div|__elem|__elemAt|__fetchurl|__filter|__filterSource|__findFile|__flakeRefToString|__floor|__foldl'|__fromJSON|__functionArgs|__genList|__genericClosure|__getAttr|__getContext|__getEnv|__getFlake|__groupBy|__hasAttr|__hasContext|__hashFile|__hashString|__head|__intersectAttrs|__isAttrs|__isBool|__isFloat|__isFunction|__isInt|__isList|__isPath|__isString|__length|__lessThan|__listToAttrs|__mapAttrs|__match|__mul|__parseDrvName|__parseFlakeRef|__partition|__path|__pathExists|__readDir|__readFile|__readFileType|__replaceStrings|__seq|__sort|__split|__splitVersion|__storePath|__stringLength|__sub|__substring|__tail|__toFile|__toJSON|__toPath|__toXML|__trace|__traceVerbose|__tryEval|__typeOf|__unsafeDiscardOutputDependency|__unsafeDiscardStringContext|__unsafeGetAttrPos|__zipAttrsWith|abort|baseNameOf|break|derivation|derivationStrict|dirOf|fetchGit|fetchMercurial|fetchTarball|fetchTree|fromTOML|import|isNull|map|placeholder|removeAttrs|scopedImport|throw|toString)$")
22
+ (#is-not? local))
23
+
24
+ [
25
+ (integer_expression)
26
+ (float_expression)
27
+ ] @number
28
+
29
+ (escape_sequence) @escape
30
+ (dollar_escape) @escape
31
+
32
+ (function_expression
33
+ universal: (identifier) @variable.parameter
34
+ )
35
+
36
+ (formal
37
+ name: (identifier) @variable.parameter
38
+ "?"? @punctuation.delimiter)
39
+
40
+ (select_expression
41
+ attrpath: (attrpath (identifier)) @property)
42
+
43
+ (apply_expression
44
+ function: [
45
+ (variable_expression (identifier)) @function
46
+ (select_expression
47
+ attrpath: (attrpath
48
+ attr: (identifier) @function .))])
49
+
50
+ (unary_expression
51
+ operator: _ @operator)
52
+
53
+ (binary_expression
54
+ operator: _ @operator)
55
+
56
+ (variable_expression (identifier) @variable)
57
+
58
+ (binding
59
+ attrpath: (attrpath (identifier)) @property)
60
+
61
+ (identifier) @property
62
+
63
+ (inherit_from attrs: (inherited_attrs attr: (identifier) @property) )
64
+
65
+ [
66
+ ";"
67
+ "."
68
+ ","
69
+ "="
70
+ ] @punctuation.delimiter
71
+
72
+ [
73
+ "("
74
+ ")"
75
+ "["
76
+ "]"
77
+ "{"
78
+ "}"
79
+ ] @punctuation.bracket
80
+
81
+ (identifier) @variable
82
+
83
+ [
84
+ (string_expression)
85
+ (indented_string_expression)
86
+ ] @string
87
+
88
+ [
89
+ (path_expression)
90
+ (hpath_expression)
91
+ (spath_expression)
92
+ ] @string.special.path
93
+
94
+ (uri_expression) @string.special.uri
95
+
96
+ (interpolation
97
+ "${" @punctuation.special
98
+ (_) @embedded
99
+ "}" @punctuation.special)
@@ -0,0 +1,39 @@
1
+ ; mark arbitary languages with a comment
2
+ ((((comment) @injection.language) .
3
+ (indented_string_expression (string_fragment) @injection.content))
4
+ (#set! injection.combined))
5
+
6
+ ((binding
7
+ attrpath: (attrpath (identifier) @_path)
8
+ expression: (indented_string_expression
9
+ (string_fragment) @injection.content))
10
+ (#match? @_path "(^\\w*Phase|(pre|post)\\w*|(.*\\.)?\\w*([sS]cript|[hH]ook)|(.*\\.)?startup)$")
11
+ (#set! injection.language "bash")
12
+ (#set! injection.combined))
13
+
14
+ ((apply_expression
15
+ function: (apply_expression function: (_) @_func)
16
+ argument: (indented_string_expression (string_fragment) @injection.content))
17
+ (#match? @_func "(^|\\.)writeShellScript(Bin)?$")
18
+ (#set! injection.language "bash")
19
+ (#set! injection.combined))
20
+
21
+ (apply_expression
22
+ (apply_expression
23
+ function: (apply_expression
24
+ function: ((_) @_func)))
25
+ argument: (indented_string_expression (string_fragment) @injection.content)
26
+ (#match? @_func "(^|\\.)runCommand(((No)?(CC))?(Local)?)?$")
27
+ (#set! injection.language "bash")
28
+ (#set! injection.combined))
29
+
30
+ (apply_expression
31
+ function: ((_) @_func)
32
+ argument: (_ (_)* (_ (_)* (binding
33
+ attrpath: (attrpath (identifier) @_path)
34
+ expression: (indented_string_expression
35
+ (string_fragment) @injection.content))))
36
+ (#match? @_func "(^|\\.)writeShellApplication$")
37
+ (#match? @_path "^text$")
38
+ (#set! injection.language "bash")
39
+ (#set! injection.combined))
@@ -0,0 +1,33 @@
1
+ ;; when using @local.reference, tree-sitter seems to
2
+ ;; apply the scope from the identifier it has looked up,
3
+ ;; which makes sense for most languages.
4
+ ;; however, we want to highlight things as function based on their call-site,
5
+ ;; not their definition; therefore using TS's support for tracking locals
6
+ ;; impedes our ability to get the highlighting we want.
7
+ ;;
8
+ ;; also, TS doesn't seem to support scoping as implemented in languages
9
+ ;; with lazy let bindings, which results in syntax highlighting/goto-reference
10
+ ;; results that depend on the order of definitions, which is counter to the
11
+ ;; semantics of Nix.
12
+ ;;
13
+ ;; so for now we'll opt for not having any locals queries.
14
+ ;;
15
+ ;; see: https://github.com/tree-sitter/tree-sitter/issues/918
16
+
17
+ ;(function_expression
18
+ ; universal: (identifier)? @local.definition
19
+ ; formals: (formals (formal name: (identifier) @local.definition)*)
20
+ ; universal: (identifier)? @local.definition
21
+ ; ) @local.scope
22
+ ;
23
+ ;(rec_attrset_expression
24
+ ; bind: (binding
25
+ ; attrpath: (attrpath . (attr_identifier) @local.definition))
26
+ ;) @local.scope
27
+ ;
28
+ ;(let_expression
29
+ ; bind: (binding
30
+ ; attrpath: (attrpath . (attr_identifier) @local.definition))
31
+ ;) @local.scope
32
+ ;
33
+ ;(identifier) @local.reference
@@ -0,0 +1,16 @@
1
+ ;; https://tree-sitter.github.io/tree-sitter/4-code-navigation.html
2
+
3
+ ;;Function definitions
4
+ (binding
5
+ attrpath: (attrpath attr: (identifier)) @name
6
+ expression: (function_expression) @definition.function)
7
+ ;;Function/method calls
8
+ (apply_expression function: (apply_expression function: (variable_expression name: (identifier) @name)) @reference.call)
9
+
10
+ ;; TODO: (if even applicable?)
11
+ ;;Interface definitions @definition.interface
12
+ ;;Interface implementation @reference.implementation
13
+ ;;Class definitions @definition.class
14
+ ;;Class reference @reference.class
15
+ ;;Method definitions @definition.method
16
+ ;;Module definitions @definition.module
Binary file
Binary file
@@ -0,0 +1,148 @@
1
+ ; Punctuation
2
+ ;------------
3
+
4
+ [
5
+ "," "." ";" ":" "=" "|" "~" "?" "+" "-" "!" ">" "&"
6
+ "->" ";;" ":>" "+=" ":=" ".."
7
+ ] @punctuation.delimiter
8
+
9
+ ["(" ")" "[" "]" "{" "}" "[|" "|]" "[<" "[>"] @punctuation.bracket
10
+
11
+ (object_type ["<" ">"] @punctuation.bracket)
12
+
13
+ "%" @punctuation.special
14
+
15
+ (attribute ["[@" "]"] @punctuation.special)
16
+ (item_attribute ["[@@" "]"] @punctuation.special)
17
+ (floating_attribute ["[@@@" "]"] @punctuation.special)
18
+ (extension ["[%" "]"] @punctuation.special)
19
+ (item_extension ["[%%" "]"] @punctuation.special)
20
+ (quoted_extension ["{%" "}"] @punctuation.special)
21
+ (quoted_item_extension ["{%%" "}"] @punctuation.special)
22
+
23
+ ; Keywords
24
+ ;---------
25
+
26
+ [
27
+ "and" "as" "assert" "begin" "class" "constraint" "do" "done" "downto" "effect"
28
+ "else" "end" "exception" "external" "for" "fun" "function" "functor" "if" "in"
29
+ "include" "inherit" "initializer" "lazy" "let" "match" "method" "module"
30
+ "mutable" "new" "nonrec" "object" "of" "open" "private" "rec" "sig" "struct"
31
+ "then" "to" "try" "type" "val" "virtual" "when" "while" "with"
32
+ ] @keyword
33
+
34
+ ; Operators
35
+ ;----------
36
+
37
+ [
38
+ (prefix_operator)
39
+ (sign_operator)
40
+ (pow_operator)
41
+ (mult_operator)
42
+ (add_operator)
43
+ (concat_operator)
44
+ (rel_operator)
45
+ (and_operator)
46
+ (or_operator)
47
+ (assign_operator)
48
+ (hash_operator)
49
+ (indexing_operator)
50
+ (let_operator)
51
+ (let_and_operator)
52
+ (match_operator)
53
+ ] @operator
54
+
55
+ (match_expression (match_operator) @keyword)
56
+
57
+ (value_definition [(let_operator) (let_and_operator)] @keyword)
58
+
59
+ ["*" "#" "::" "<-"] @operator
60
+
61
+ ; Constants
62
+ ;----------
63
+
64
+ (boolean) @constant
65
+
66
+ [(number) (signed_number)] @number
67
+
68
+ [(string) (character)] @string
69
+
70
+ (quoted_string "{" @string "}" @string) @string
71
+
72
+ (escape_sequence) @escape
73
+
74
+ (conversion_specification) @string.special
75
+
76
+ ; Variables
77
+ ;----------
78
+
79
+ [(value_name) (type_variable)] @variable
80
+
81
+ (value_pattern) @variable.parameter
82
+
83
+ ; Properties
84
+ ;-----------
85
+
86
+ [(label_name) (field_name) (instance_variable_name)] @property
87
+
88
+ ; Functions
89
+ ;----------
90
+
91
+ (let_binding
92
+ pattern: (value_name) @function
93
+ (parameter))
94
+
95
+ (let_binding
96
+ pattern: (value_name) @function
97
+ body: [(fun_expression) (function_expression)])
98
+
99
+ (value_specification (value_name) @function)
100
+
101
+ (external (value_name) @function)
102
+
103
+ (method_name) @function.method
104
+
105
+ (application_expression
106
+ function: (value_path (value_name) @function))
107
+
108
+ (infix_expression
109
+ left: (value_path (value_name) @function)
110
+ operator: (concat_operator) @operator
111
+ (#eq? @operator "@@"))
112
+
113
+ (infix_expression
114
+ operator: (rel_operator) @operator
115
+ right: (value_path (value_name) @function)
116
+ (#eq? @operator "|>"))
117
+
118
+ (
119
+ (value_name) @function.builtin
120
+ (#match? @function.builtin "^(raise(_notrace)?|failwith|invalid_arg)$")
121
+ )
122
+
123
+ ; Types
124
+ ;------
125
+
126
+ [(class_name) (class_type_name) (type_constructor)] @type
127
+
128
+ (
129
+ (type_constructor) @type.builtin
130
+ (#match? @type.builtin "^(int|char|bytes|string|float|bool|unit|exn|array|list|option|int32|int64|nativeint|format6|lazy_t)$")
131
+ )
132
+
133
+ [(constructor_name) (tag)] @constructor
134
+
135
+ ; Modules
136
+ ;--------
137
+
138
+ [(module_name) (module_type_name)] @module
139
+
140
+ ; Attributes
141
+ ;-----------
142
+
143
+ (attribute_id) @tag
144
+
145
+ ; Comments
146
+ ;---------
147
+
148
+ [(comment) (line_number_directive) (directive) (shebang)] @comment
@@ -0,0 +1,24 @@
1
+ ; Scopes
2
+ ;-------
3
+
4
+ [
5
+ (let_binding)
6
+ (class_binding)
7
+ (class_function)
8
+ (method_definition)
9
+ (fun_expression)
10
+ (object_expression)
11
+ (for_expression)
12
+ (match_case)
13
+ (attribute_payload)
14
+ ] @local.scope
15
+
16
+ ; Definitions
17
+ ;------------
18
+
19
+ (value_pattern) @local.definition
20
+
21
+ ; References
22
+ ;-----------
23
+
24
+ (value_path . (value_name) @local.reference)
@@ -0,0 +1,170 @@
1
+ ; Modules
2
+ ;--------
3
+
4
+ (
5
+ (comment)? @doc .
6
+ (module_definition
7
+ (module_binding (module_name) @name) @definition.module
8
+ )
9
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
10
+ )
11
+
12
+ (module_path (module_name) @name) @reference.module
13
+ (extended_module_path (module_name) @name) @reference.module
14
+
15
+ (
16
+ (comment)? @doc .
17
+ (module_type_definition (module_type_name) @name) @definition.interface
18
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
19
+ )
20
+
21
+ (module_type_path (module_type_name) @name) @reference.implementation
22
+
23
+
24
+ ; Classes
25
+ ;--------
26
+
27
+ (
28
+ (comment)? @doc .
29
+ [
30
+ (class_definition
31
+ (class_binding (class_name) @name) @definition.class
32
+ )
33
+ (class_type_definition
34
+ (class_type_binding (class_type_name) @name) @definition.class
35
+ )
36
+ ]
37
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
38
+ )
39
+
40
+ [
41
+ (class_path (class_name) @name)
42
+ (class_type_path (class_type_name) @name)
43
+ ] @reference.class
44
+
45
+ (
46
+ (comment)? @doc .
47
+ (method_definition (method_name) @name) @definition.method
48
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
49
+ )
50
+
51
+ (method_invocation (method_name) @name) @reference.call
52
+
53
+
54
+ ; Types
55
+ ;------
56
+
57
+ (
58
+ (comment)? @doc .
59
+ (type_definition
60
+ (type_binding
61
+ name: [
62
+ (type_constructor) @name
63
+ (type_constructor_path (type_constructor) @name)
64
+ ]
65
+ ) @definition.type
66
+ )
67
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
68
+ )
69
+
70
+ (type_constructor_path (type_constructor) @name) @reference.type
71
+
72
+ [
73
+ (constructor_declaration (constructor_name) @name)
74
+ (tag_specification (tag) @name)
75
+ ] @definition.enum_variant
76
+
77
+ [
78
+ (constructor_path (constructor_name) @name)
79
+ (tag) @name
80
+ ] @reference.enum_variant
81
+
82
+ (field_declaration (field_name) @name) @definition.field
83
+
84
+ (field_path (field_name) @name) @reference.field
85
+
86
+
87
+ ; Functions
88
+ ;----------
89
+
90
+ (
91
+ (comment)? @doc .
92
+ (value_definition
93
+ [
94
+ (let_binding pattern: (value_name) @name (parameter))
95
+ (let_binding
96
+ pattern: (value_name) @name
97
+ body: [(fun_expression) (function_expression)]
98
+ )
99
+ ] @definition.function
100
+ )
101
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
102
+ )
103
+
104
+ (
105
+ (comment)? @doc .
106
+ (external (value_name) @name) @definition.function
107
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
108
+ )
109
+
110
+ (application_expression
111
+ function: (value_path (value_name) @name)
112
+ ) @reference.call
113
+
114
+ (infix_expression
115
+ left: (value_path (value_name) @name)
116
+ operator: (concat_operator) @reference.call
117
+ (#eq? @reference.call "@@")
118
+ )
119
+
120
+ (infix_expression
121
+ operator: (rel_operator) @reference.call
122
+ right: (value_path (value_name) @name)
123
+ (#eq? @reference.call "|>")
124
+ )
125
+
126
+
127
+ ; Operators
128
+ ;----------
129
+
130
+ (
131
+ (comment)? @doc .
132
+ (value_definition
133
+ [
134
+ (let_binding pattern: (parenthesized_operator (_) @name) (parameter))
135
+ (let_binding
136
+ pattern: (parenthesized_operator (_) @name)
137
+ body: [(fun_expression) (function_expression)]
138
+ )
139
+ ] @definition.operator
140
+ )
141
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
142
+ )
143
+
144
+ (application_expression
145
+ function: (value_path (parenthesized_operator (_) @name))
146
+ ) @reference.call
147
+
148
+ (infix_expression
149
+ left: (value_path (parenthesized_operator (_) @name))
150
+ operator: (concat_operator) @reference.call
151
+ (#eq? @reference.call "@@")
152
+ )
153
+
154
+ (infix_expression
155
+ operator: (rel_operator) @reference.call
156
+ right: (value_path (parenthesized_operator (_) @name))
157
+ (#eq? @reference.call "|>")
158
+ )
159
+
160
+ (prefix_expression operator: (prefix_operator) @name) @reference.call
161
+
162
+ (hash_expression operator: (hash_operator) @name) @reference.call
163
+
164
+ (infix_expression operator: (_) @name) @reference.call
165
+
166
+ (indexing_operator_path (indexing_operator) @name) @reference.call
167
+
168
+ (value_definition [(let_operator) (let_and_operator)] @name) @reference.call
169
+
170
+ (match_expression (match_operator) @name) @reference.call
Binary file