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 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
- seq(/[^'\r\n][^\r\n]*[ \t]'VBS/, /[^\r\n]*/),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-batch",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "A Windows Batch/CMD grammar for tree-sitter",
5
5
  "type": "module",
6
6
  "repository": {
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",