tree-sitter-java-orchard 0.5.2
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/LICENSE +21 -0
- package/README.md +14 -0
- package/binding.gyp +35 -0
- package/bindings/node/binding.cc +19 -0
- package/bindings/node/binding_test.js +9 -0
- package/bindings/node/index.d.ts +27 -0
- package/bindings/node/index.js +11 -0
- package/grammar.js +1361 -0
- package/package.json +52 -0
- package/queries/highlights.scm +149 -0
- package/queries/tags.scm +20 -0
- package/src/grammar.json +7946 -0
- package/src/node-types.json +4625 -0
- package/src/parser.c +77406 -0
- package/src/tree_sitter/alloc.h +54 -0
- package/src/tree_sitter/array.h +291 -0
- package/src/tree_sitter/parser.h +286 -0
- package/tree-sitter-java_orchard.wasm +0 -0
- package/tree-sitter.json +47 -0
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tree-sitter-java-orchard",
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "Java grammar for tree-sitter",
|
|
5
|
+
"repository": "https://codeberg.org/grammar-orchard/tree-sitter-java-orchard",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Ayman Nadeem",
|
|
9
|
+
"email": "aymannadeem@github.com"
|
|
10
|
+
},
|
|
11
|
+
"main": "bindings/node",
|
|
12
|
+
"types": "bindings/node",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"incremental",
|
|
15
|
+
"parsing",
|
|
16
|
+
"tree-sitter",
|
|
17
|
+
"java_orchard"
|
|
18
|
+
],
|
|
19
|
+
"files": [
|
|
20
|
+
"grammar.js",
|
|
21
|
+
"tree-sitter.json",
|
|
22
|
+
"binding.gyp",
|
|
23
|
+
"prebuilds/**",
|
|
24
|
+
"bindings/node/*",
|
|
25
|
+
"queries/*",
|
|
26
|
+
"src/**",
|
|
27
|
+
"*.wasm"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"node-addon-api": "^8.3.1",
|
|
31
|
+
"node-gyp-build": "^4.8.4"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"prebuildify": "^6.0.1",
|
|
35
|
+
"tree-sitter": "^0.25.0",
|
|
36
|
+
"tree-sitter-cli": "^0.25.5"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"tree-sitter": "^0.25.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"tree-sitter": {
|
|
43
|
+
"optional": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"install": "node-gyp-build",
|
|
48
|
+
"prestart": "tree-sitter build --wasm",
|
|
49
|
+
"start": "tree-sitter playground",
|
|
50
|
+
"test": "node --test bindings/node/*_test.js"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
; Variables
|
|
2
|
+
|
|
3
|
+
(identifier) @variable
|
|
4
|
+
|
|
5
|
+
; Methods
|
|
6
|
+
|
|
7
|
+
(method_declaration
|
|
8
|
+
name: (identifier) @function.method)
|
|
9
|
+
(method_invocation
|
|
10
|
+
name: (identifier) @function.method)
|
|
11
|
+
(super) @function.builtin
|
|
12
|
+
|
|
13
|
+
; Annotations
|
|
14
|
+
|
|
15
|
+
(annotation
|
|
16
|
+
name: (identifier) @attribute)
|
|
17
|
+
(marker_annotation
|
|
18
|
+
name: (identifier) @attribute)
|
|
19
|
+
|
|
20
|
+
"@" @operator
|
|
21
|
+
|
|
22
|
+
; Types
|
|
23
|
+
|
|
24
|
+
(type_identifier) @type
|
|
25
|
+
|
|
26
|
+
(interface_declaration
|
|
27
|
+
name: (identifier) @type)
|
|
28
|
+
(class_declaration
|
|
29
|
+
name: (identifier) @type)
|
|
30
|
+
(enum_declaration
|
|
31
|
+
name: (identifier) @type)
|
|
32
|
+
|
|
33
|
+
((field_access
|
|
34
|
+
object: (identifier) @type)
|
|
35
|
+
(#match? @type "^[A-Z]"))
|
|
36
|
+
((scoped_identifier
|
|
37
|
+
scope: (identifier) @type)
|
|
38
|
+
(#match? @type "^[A-Z]"))
|
|
39
|
+
((method_invocation
|
|
40
|
+
object: (identifier) @type)
|
|
41
|
+
(#match? @type "^[A-Z]"))
|
|
42
|
+
((method_reference
|
|
43
|
+
. (identifier) @type)
|
|
44
|
+
(#match? @type "^[A-Z]"))
|
|
45
|
+
|
|
46
|
+
(constructor_declaration
|
|
47
|
+
name: (identifier) @type)
|
|
48
|
+
|
|
49
|
+
[
|
|
50
|
+
(boolean_type)
|
|
51
|
+
(integral_type)
|
|
52
|
+
(floating_point_type)
|
|
53
|
+
(floating_point_type)
|
|
54
|
+
(void_type)
|
|
55
|
+
] @type.builtin
|
|
56
|
+
|
|
57
|
+
; Constants
|
|
58
|
+
|
|
59
|
+
((identifier) @constant
|
|
60
|
+
(#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
|
|
61
|
+
|
|
62
|
+
; Builtins
|
|
63
|
+
|
|
64
|
+
(this) @variable.builtin
|
|
65
|
+
|
|
66
|
+
; Literals
|
|
67
|
+
|
|
68
|
+
[
|
|
69
|
+
(hex_integer_literal)
|
|
70
|
+
(decimal_integer_literal)
|
|
71
|
+
(octal_integer_literal)
|
|
72
|
+
(decimal_floating_point_literal)
|
|
73
|
+
(hex_floating_point_literal)
|
|
74
|
+
] @number
|
|
75
|
+
|
|
76
|
+
[
|
|
77
|
+
(character_literal)
|
|
78
|
+
(string_literal)
|
|
79
|
+
] @string
|
|
80
|
+
(escape_sequence) @string.escape
|
|
81
|
+
|
|
82
|
+
[
|
|
83
|
+
(true)
|
|
84
|
+
(false)
|
|
85
|
+
(null_literal)
|
|
86
|
+
] @constant.builtin
|
|
87
|
+
|
|
88
|
+
[
|
|
89
|
+
(line_comment)
|
|
90
|
+
(block_comment)
|
|
91
|
+
] @comment
|
|
92
|
+
|
|
93
|
+
; Keywords
|
|
94
|
+
|
|
95
|
+
[
|
|
96
|
+
"abstract"
|
|
97
|
+
"assert"
|
|
98
|
+
"break"
|
|
99
|
+
"case"
|
|
100
|
+
"catch"
|
|
101
|
+
"class"
|
|
102
|
+
"continue"
|
|
103
|
+
"default"
|
|
104
|
+
"do"
|
|
105
|
+
"else"
|
|
106
|
+
"enum"
|
|
107
|
+
"exports"
|
|
108
|
+
"extends"
|
|
109
|
+
"final"
|
|
110
|
+
"finally"
|
|
111
|
+
"for"
|
|
112
|
+
"if"
|
|
113
|
+
"implements"
|
|
114
|
+
"import"
|
|
115
|
+
"instanceof"
|
|
116
|
+
"interface"
|
|
117
|
+
"module"
|
|
118
|
+
"native"
|
|
119
|
+
"new"
|
|
120
|
+
"non-sealed"
|
|
121
|
+
"open"
|
|
122
|
+
"opens"
|
|
123
|
+
"package"
|
|
124
|
+
"permits"
|
|
125
|
+
"private"
|
|
126
|
+
"protected"
|
|
127
|
+
"provides"
|
|
128
|
+
"public"
|
|
129
|
+
"requires"
|
|
130
|
+
"record"
|
|
131
|
+
"return"
|
|
132
|
+
"sealed"
|
|
133
|
+
"static"
|
|
134
|
+
"strictfp"
|
|
135
|
+
"switch"
|
|
136
|
+
"synchronized"
|
|
137
|
+
"throw"
|
|
138
|
+
"throws"
|
|
139
|
+
"to"
|
|
140
|
+
"transient"
|
|
141
|
+
"transitive"
|
|
142
|
+
"try"
|
|
143
|
+
"uses"
|
|
144
|
+
"volatile"
|
|
145
|
+
"when"
|
|
146
|
+
"while"
|
|
147
|
+
"with"
|
|
148
|
+
"yield"
|
|
149
|
+
] @keyword
|
package/queries/tags.scm
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
(class_declaration
|
|
2
|
+
name: (identifier) @name) @definition.class
|
|
3
|
+
|
|
4
|
+
(method_declaration
|
|
5
|
+
name: (identifier) @name) @definition.method
|
|
6
|
+
|
|
7
|
+
(method_invocation
|
|
8
|
+
name: (identifier) @name
|
|
9
|
+
arguments: (argument_list) @reference.call)
|
|
10
|
+
|
|
11
|
+
(interface_declaration
|
|
12
|
+
name: (identifier) @name) @definition.interface
|
|
13
|
+
|
|
14
|
+
(type_list
|
|
15
|
+
(type_identifier) @name) @reference.implementation
|
|
16
|
+
|
|
17
|
+
(object_creation_expression
|
|
18
|
+
type: (type_identifier) @name) @reference.class
|
|
19
|
+
|
|
20
|
+
(superclass (type_identifier) @name) @reference.class
|