@konomanoasa/tree-sitter-posix-awk 0.7.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/CMakeLists.txt +90 -0
- package/Cargo.toml +27 -0
- package/LICENSE +21 -0
- package/Makefile +131 -0
- package/README.md +30 -0
- package/bindings/c/tree-sitter-posix-awk.pc.in +10 -0
- package/bindings/c/tree_sitter/tree-sitter-posix-awk.h +16 -0
- package/bindings/rust/build.rs +46 -0
- package/bindings/rust/lib.rs +60 -0
- package/grammar.js +1730 -0
- package/package.json +39 -0
- package/queries/highlights.scm +210 -0
- package/src/grammar.json +10802 -0
- package/src/node-types.json +3003 -0
- package/src/parser.c +657342 -0
- package/src/scanner.c +1319 -0
- package/src/tree_sitter/alloc.h +54 -0
- package/src/tree_sitter/array.h +336 -0
- package/src/tree_sitter/parser.h +286 -0
- package/test/binding.test.c +6 -0
- package/tree-sitter.json +34 -0
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@konomanoasa/tree-sitter-posix-awk",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Tree-sitter grammar for POSIX awk.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "git+https://github.com/konomanoasa/tree-sitter-posix-awk.git",
|
|
7
|
+
"files": [
|
|
8
|
+
"bindings/c",
|
|
9
|
+
"bindings/rust",
|
|
10
|
+
"Cargo.toml",
|
|
11
|
+
"CMakeLists.txt",
|
|
12
|
+
"grammar.js",
|
|
13
|
+
"Makefile",
|
|
14
|
+
"queries/*.scm",
|
|
15
|
+
"src/*.c",
|
|
16
|
+
"src/*.json",
|
|
17
|
+
"src/tree_sitter/*.h",
|
|
18
|
+
"test/binding.test.c",
|
|
19
|
+
"tree-sitter.json"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"check": "biome check . && node scripts/check-c.js && node scripts/check-generated.js && npm test",
|
|
26
|
+
"format": "biome check --write . && node scripts/check-c.js --write",
|
|
27
|
+
"generate": "npm run tree-sitter -- generate",
|
|
28
|
+
"test": "npm run tree-sitter -- test --rebuild && node --test",
|
|
29
|
+
"test:fuzz": "npm run tree-sitter -- fuzz --rebuild --iterations 100 --edits 5",
|
|
30
|
+
"tree-sitter": "node scripts/tree-sitter.js"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@biomejs/biome": "2.5.11",
|
|
34
|
+
"tree-sitter-cli": "0.27.0"
|
|
35
|
+
},
|
|
36
|
+
"allowScripts": {
|
|
37
|
+
"tree-sitter-cli": true
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
(string_content) @string
|
|
2
|
+
|
|
3
|
+
(comment) @comment
|
|
4
|
+
|
|
5
|
+
(line_continuation) @punctuation.special
|
|
6
|
+
|
|
7
|
+
[
|
|
8
|
+
(number)
|
|
9
|
+
(dup_count)
|
|
10
|
+
] @number
|
|
11
|
+
|
|
12
|
+
(name) @variable
|
|
13
|
+
|
|
14
|
+
(func_name) @function.call
|
|
15
|
+
|
|
16
|
+
(builtin_func_name) @function.builtin
|
|
17
|
+
|
|
18
|
+
[
|
|
19
|
+
(begin_keyword)
|
|
20
|
+
(break_keyword)
|
|
21
|
+
(continue_keyword)
|
|
22
|
+
(delete_keyword)
|
|
23
|
+
(do_keyword)
|
|
24
|
+
(else_keyword)
|
|
25
|
+
(end_keyword)
|
|
26
|
+
(exit_keyword)
|
|
27
|
+
(for_keyword)
|
|
28
|
+
(function_keyword)
|
|
29
|
+
(getline_keyword)
|
|
30
|
+
(if_keyword)
|
|
31
|
+
(in_keyword)
|
|
32
|
+
(next_keyword)
|
|
33
|
+
(nextfile_keyword)
|
|
34
|
+
(print_keyword)
|
|
35
|
+
(printf_keyword)
|
|
36
|
+
(return_keyword)
|
|
37
|
+
(while_keyword)
|
|
38
|
+
] @keyword
|
|
39
|
+
|
|
40
|
+
[
|
|
41
|
+
(add_assign)
|
|
42
|
+
(and)
|
|
43
|
+
(append)
|
|
44
|
+
(decr)
|
|
45
|
+
(div_assign)
|
|
46
|
+
(eq)
|
|
47
|
+
(ge)
|
|
48
|
+
(incr)
|
|
49
|
+
(le)
|
|
50
|
+
(mod_assign)
|
|
51
|
+
(mul_assign)
|
|
52
|
+
(ne)
|
|
53
|
+
(no_match)
|
|
54
|
+
(or)
|
|
55
|
+
(pow_assign)
|
|
56
|
+
(sub_assign)
|
|
57
|
+
(left_anchor)
|
|
58
|
+
(right_anchor)
|
|
59
|
+
(repetition_modifier)
|
|
60
|
+
"!"
|
|
61
|
+
"$"
|
|
62
|
+
"%"
|
|
63
|
+
"*"
|
|
64
|
+
"+"
|
|
65
|
+
"-"
|
|
66
|
+
"/"
|
|
67
|
+
":"
|
|
68
|
+
"<"
|
|
69
|
+
"="
|
|
70
|
+
">"
|
|
71
|
+
"?"
|
|
72
|
+
"^"
|
|
73
|
+
"|"
|
|
74
|
+
"~"
|
|
75
|
+
] @operator
|
|
76
|
+
|
|
77
|
+
[
|
|
78
|
+
","
|
|
79
|
+
";"
|
|
80
|
+
] @punctuation.delimiter
|
|
81
|
+
|
|
82
|
+
[
|
|
83
|
+
"("
|
|
84
|
+
")"
|
|
85
|
+
"{"
|
|
86
|
+
"}"
|
|
87
|
+
] @punctuation.bracket
|
|
88
|
+
|
|
89
|
+
(lvalue
|
|
90
|
+
"[" @punctuation.bracket
|
|
91
|
+
"]" @punctuation.bracket)
|
|
92
|
+
|
|
93
|
+
(simple_statement
|
|
94
|
+
"[" @punctuation.bracket
|
|
95
|
+
"]" @punctuation.bracket)
|
|
96
|
+
|
|
97
|
+
(string
|
|
98
|
+
opening: "\"" @punctuation.delimiter)
|
|
99
|
+
|
|
100
|
+
(string
|
|
101
|
+
closing: "\"" @punctuation.delimiter)
|
|
102
|
+
|
|
103
|
+
(ere
|
|
104
|
+
opening: "/" @punctuation.delimiter)
|
|
105
|
+
|
|
106
|
+
(ere
|
|
107
|
+
closing: "/" @punctuation.delimiter)
|
|
108
|
+
|
|
109
|
+
(ordinary_character) @string.regexp
|
|
110
|
+
|
|
111
|
+
[
|
|
112
|
+
(collating_element)
|
|
113
|
+
(meta_character)
|
|
114
|
+
(class_name)
|
|
115
|
+
(wildcard)
|
|
116
|
+
] @character.special
|
|
117
|
+
|
|
118
|
+
(nonmatching_list
|
|
119
|
+
"^" @operator)
|
|
120
|
+
|
|
121
|
+
(start_range
|
|
122
|
+
"-" @operator)
|
|
123
|
+
|
|
124
|
+
(collating_element
|
|
125
|
+
"-" @string.regexp)
|
|
126
|
+
|
|
127
|
+
(bracket_list
|
|
128
|
+
"-" @string.regexp)
|
|
129
|
+
|
|
130
|
+
(range_expression
|
|
131
|
+
"-" @string.regexp)
|
|
132
|
+
|
|
133
|
+
(bracket_expression
|
|
134
|
+
"[" @punctuation.bracket
|
|
135
|
+
"]" @punctuation.bracket)
|
|
136
|
+
|
|
137
|
+
(character_class
|
|
138
|
+
[
|
|
139
|
+
"["
|
|
140
|
+
"]"
|
|
141
|
+
] @punctuation.bracket)
|
|
142
|
+
|
|
143
|
+
(character_class
|
|
144
|
+
":" @punctuation.delimiter)
|
|
145
|
+
|
|
146
|
+
(collating_symbol
|
|
147
|
+
[
|
|
148
|
+
"["
|
|
149
|
+
"]"
|
|
150
|
+
] @punctuation.bracket)
|
|
151
|
+
|
|
152
|
+
(collating_symbol
|
|
153
|
+
"." @punctuation.delimiter)
|
|
154
|
+
|
|
155
|
+
(equivalence_class
|
|
156
|
+
[
|
|
157
|
+
"["
|
|
158
|
+
"]"
|
|
159
|
+
] @punctuation.bracket)
|
|
160
|
+
|
|
161
|
+
(equivalence_class
|
|
162
|
+
"=" @punctuation.delimiter)
|
|
163
|
+
|
|
164
|
+
[
|
|
165
|
+
(escaped_delimiter)
|
|
166
|
+
(quoted_character)
|
|
167
|
+
(escape_sequence)
|
|
168
|
+
] @string.escape
|
|
169
|
+
|
|
170
|
+
(ordinary_character
|
|
171
|
+
[
|
|
172
|
+
")"
|
|
173
|
+
"}"
|
|
174
|
+
] @string.regexp)
|
|
175
|
+
|
|
176
|
+
(escaped_delimiter
|
|
177
|
+
"/" @string.escape)
|
|
178
|
+
|
|
179
|
+
(non_unary_expr
|
|
180
|
+
"?" @keyword.conditional.ternary)
|
|
181
|
+
|
|
182
|
+
(unary_expr
|
|
183
|
+
"?" @keyword.conditional.ternary)
|
|
184
|
+
|
|
185
|
+
(non_unary_print_expr
|
|
186
|
+
"?" @keyword.conditional.ternary)
|
|
187
|
+
|
|
188
|
+
(unary_print_expr
|
|
189
|
+
"?" @keyword.conditional.ternary)
|
|
190
|
+
|
|
191
|
+
(non_unary_expr
|
|
192
|
+
":" @keyword.conditional.ternary)
|
|
193
|
+
|
|
194
|
+
(unary_expr
|
|
195
|
+
":" @keyword.conditional.ternary)
|
|
196
|
+
|
|
197
|
+
(non_unary_print_expr
|
|
198
|
+
":" @keyword.conditional.ternary)
|
|
199
|
+
|
|
200
|
+
(unary_print_expr
|
|
201
|
+
":" @keyword.conditional.ternary)
|
|
202
|
+
|
|
203
|
+
(item
|
|
204
|
+
name: [
|
|
205
|
+
(name)
|
|
206
|
+
(func_name)
|
|
207
|
+
] @function)
|
|
208
|
+
|
|
209
|
+
(param_list
|
|
210
|
+
(name) @variable.parameter)
|