@dekobon/tree-sitter-groovy 0.5.0 → 0.6.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 +25 -4
- package/grammar.js +627 -129
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/@dekobon+tree-sitter-groovy.node +0 -0
- package/prebuilds/linux-x64/@dekobon+tree-sitter-groovy.node +0 -0
- package/prebuilds/win32-x64/@dekobon+tree-sitter-groovy.node +0 -0
- package/queries/groovy/highlights.scm +10 -4
- package/queries/groovy/locals.scm +7 -0
- package/queries/groovy/tags.scm +32 -0
- package/src/grammar.json +1765 -442
- package/src/node-types.json +593 -3
- package/src/parser.c +194884 -146231
- package/src/scanner.c +275 -24
- package/tree-sitter.json +2 -1
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -97,6 +97,8 @@
|
|
|
97
97
|
".@"
|
|
98
98
|
"::"
|
|
99
99
|
"*:"
|
|
100
|
+
"->"
|
|
101
|
+
"..."
|
|
100
102
|
] @operator
|
|
101
103
|
|
|
102
104
|
; -- Layer 3: generic identifier fallback --------------------------
|
|
@@ -112,10 +114,10 @@
|
|
|
112
114
|
"instanceof"
|
|
113
115
|
] @keyword.operator
|
|
114
116
|
|
|
115
|
-
; `!
|
|
116
|
-
;
|
|
117
|
-
;
|
|
118
|
-
;
|
|
117
|
+
; `!instanceof` is a composite token (literal + trailing whitespace)
|
|
118
|
+
; per SPECIFICATION.md §3.2.2, so it cannot be referenced as a direct
|
|
119
|
+
; anonymous token in a `[ … ]` group. Capture it, and `!in` with it,
|
|
120
|
+
; through the operator field instead.
|
|
119
121
|
(membership_expression operator: _ @keyword.operator)
|
|
120
122
|
(instanceof_expression operator: _ @keyword.operator)
|
|
121
123
|
|
|
@@ -172,6 +174,10 @@
|
|
|
172
174
|
"strictfp"
|
|
173
175
|
] @keyword.modifier
|
|
174
176
|
|
|
177
|
+
; `synchronized (lock) { … }` is a statement; the word is a modifier
|
|
178
|
+
; everywhere else.
|
|
179
|
+
(synchronized_statement "synchronized" @keyword)
|
|
180
|
+
|
|
175
181
|
(shebang) @keyword.directive
|
|
176
182
|
|
|
177
183
|
; -- Layer 5: dot-family property captures -------------------------
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
; Scopes — anywhere a new symbol table is opened.
|
|
9
9
|
[
|
|
10
10
|
(class_body)
|
|
11
|
+
(enum_body)
|
|
12
|
+
(record_declaration)
|
|
11
13
|
(block)
|
|
12
14
|
(closure)
|
|
13
15
|
(method_declaration)
|
|
@@ -16,12 +18,17 @@
|
|
|
16
18
|
(for_statement)
|
|
17
19
|
(for_in_statement)
|
|
18
20
|
(catch_clause)
|
|
21
|
+
(try_statement)
|
|
19
22
|
] @local.scope
|
|
20
23
|
|
|
21
24
|
; Definitions — bound names introduced inside their enclosing scope.
|
|
22
25
|
(formal_parameter name: (identifier) @local.definition.parameter)
|
|
23
26
|
(closure_parameter name: (identifier) @local.definition.parameter)
|
|
24
27
|
(variable_declarator name: (identifier) @local.definition.var)
|
|
28
|
+
; A typed local has its name on the declaration itself, with no
|
|
29
|
+
; `variable_declarator`: `String s = 'a'`, `final String s`.
|
|
30
|
+
(local_variable_declaration name: (identifier) @local.definition.var)
|
|
31
|
+
(resource name: (identifier) @local.definition.var)
|
|
25
32
|
(field_declaration
|
|
26
33
|
(variable_declarator name: (identifier) @local.definition.field))
|
|
27
34
|
(for_in_statement variable: (identifier) @local.definition.var)
|
package/queries/groovy/tags.scm
CHANGED
|
@@ -65,3 +65,35 @@
|
|
|
65
65
|
(super_interfaces (type_identifier) @name) @reference.implementation
|
|
66
66
|
|
|
67
67
|
(extends_interfaces (type_identifier) @name) @reference.implementation
|
|
68
|
+
|
|
69
|
+
; A generic super type is tagged by its base, and a qualified one by
|
|
70
|
+
; its last segment: `implements Supplier<String>, a.b.Shaded`.
|
|
71
|
+
(superclass
|
|
72
|
+
(generic_type base: (type_identifier) @name)) @reference.class
|
|
73
|
+
|
|
74
|
+
(superclass
|
|
75
|
+
(qualified_type (type_identifier) @name .)) @reference.class
|
|
76
|
+
|
|
77
|
+
(superclass
|
|
78
|
+
(generic_type
|
|
79
|
+
base: (qualified_type (type_identifier) @name .))) @reference.class
|
|
80
|
+
|
|
81
|
+
(super_interfaces
|
|
82
|
+
(generic_type base: (type_identifier) @name)) @reference.implementation
|
|
83
|
+
|
|
84
|
+
(super_interfaces
|
|
85
|
+
(qualified_type (type_identifier) @name .)) @reference.implementation
|
|
86
|
+
|
|
87
|
+
(super_interfaces
|
|
88
|
+
(generic_type
|
|
89
|
+
base: (qualified_type (type_identifier) @name .))) @reference.implementation
|
|
90
|
+
|
|
91
|
+
(extends_interfaces
|
|
92
|
+
(generic_type base: (type_identifier) @name)) @reference.implementation
|
|
93
|
+
|
|
94
|
+
(extends_interfaces
|
|
95
|
+
(qualified_type (type_identifier) @name .)) @reference.implementation
|
|
96
|
+
|
|
97
|
+
(extends_interfaces
|
|
98
|
+
(generic_type
|
|
99
|
+
base: (qualified_type (type_identifier) @name .))) @reference.implementation
|