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
@@ -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
@@ -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
@@ -0,0 +1,27 @@
1
+ (comment)+ @fold
2
+ (pod) @fold
3
+ (heredoc_content) @fold
4
+
5
+ ; fold the block-typed package statements only
6
+ (package_statement (block)) @fold
7
+ (class_statement (block)) @fold
8
+
9
+ [(subroutine_declaration_statement)
10
+ (method_declaration_statement)
11
+ (conditional_statement)
12
+ (loop_statement)
13
+ (for_statement)
14
+ (cstyle_for_statement)
15
+ (block_statement)
16
+ (defer_statement)
17
+ (phaser_statement)] @fold
18
+
19
+ (try_statement (block) @fold)
20
+
21
+ (eval_expression (block) @fold)
22
+
23
+ (anonymous_subroutine_expression) @fold
24
+
25
+ ; perhaps folks want to fold these too?
26
+ [(anonymous_array_expression)
27
+ (anonymous_hash_expression)] @fold