tree-sitter-batch 0.11.0 → 0.11.1
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/grammar.js +11 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/tree-sitter-batch.node +0 -0
- package/prebuilds/darwin-x64/tree-sitter-batch.node +0 -0
- package/prebuilds/linux-arm64/tree-sitter-batch.node +0 -0
- package/prebuilds/linux-x64/tree-sitter-batch.node +0 -0
- package/prebuilds/win32-arm64/tree-sitter-batch.node +0 -0
- package/prebuilds/win32-x64/tree-sitter-batch.node +0 -0
- package/src/grammar.json +14 -1
- package/src/parser.c +2971 -3107
- package/tree-sitter-batch.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -58,7 +58,17 @@ export default grammar({
|
|
|
58
58
|
// marker are extracted by the script itself as VBScript; the batch
|
|
59
59
|
// interpreter never runs them. Consume the rest of the line after the
|
|
60
60
|
// marker so any trailing VBScript tokens don't leak into the batch parse.
|
|
61
|
-
|
|
61
|
+
// Two branches are needed:
|
|
62
|
+
// - lines with code before the marker: `...content... [ \t]'VBS rest`
|
|
63
|
+
// (covers e.g. `Set foo = ... 'VBS`);
|
|
64
|
+
// - the blank-separator VBS line that is whitespace-only before `'VBS`
|
|
65
|
+
// — `extras` consumes the leading whitespace, so the token starts
|
|
66
|
+
// directly at `'VBS` (covers CheckEOL.bat-style polyglot separators).
|
|
67
|
+
// The first branch's leading char class must exclude ` ` and `\t` —
|
|
68
|
+
// otherwise this high-precedence branch starts tokens inside leading
|
|
69
|
+
// whitespace and bleeds into `command_name`'s span on indented lines.
|
|
70
|
+
seq(/[^ \t'\r\n][^\r\n]*[ \t]'VBS/, /[^\r\n]*/),
|
|
71
|
+
seq('\'VBS', /[^\r\n]*/),
|
|
62
72
|
))),
|
|
63
73
|
label: () => token(seq(':', /[$a-zA-Z_][$a-zA-Z0-9_.#-]*/, optional(seq(/[ \t]/, /[^\r\n]*/)))),
|
|
64
74
|
variable_assignment: ($) => prec(8, seq(
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/grammar.json
CHANGED
|
@@ -258,7 +258,20 @@
|
|
|
258
258
|
"members": [
|
|
259
259
|
{
|
|
260
260
|
"type": "PATTERN",
|
|
261
|
-
"value": "[^'\\r\\n][^\\r\\n]*[ \\t]'VBS"
|
|
261
|
+
"value": "[^ \\t'\\r\\n][^\\r\\n]*[ \\t]'VBS"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"type": "PATTERN",
|
|
265
|
+
"value": "[^\\r\\n]*"
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"type": "SEQ",
|
|
271
|
+
"members": [
|
|
272
|
+
{
|
|
273
|
+
"type": "STRING",
|
|
274
|
+
"value": "'VBS"
|
|
262
275
|
},
|
|
263
276
|
{
|
|
264
277
|
"type": "PATTERN",
|