@willbooster/tree-sitter-embedded-template 10.0.0 → 12.0.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 CHANGED
@@ -16,22 +16,22 @@ It parses templating languages such as ERB and EJS, in which scripting code is e
16
16
  `<%` and `%>`. This fork extends upstream's version 0.25.0 grammar with EJS output-tag whitespace slurping,
17
17
  trimming closers on comments, and the `=%>` closer on statements.
18
18
  It generates the parser with the
19
- [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator (ABI `0x5742000c`). The parser loads only
19
+ [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator (ABI `0x5742000d`). The parser loads only
20
20
  with that fork's runtime ([willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter),
21
21
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter)); upstream's runtime rejects it.
22
- This package targets and is tested with version 19.1.1 or later in the 19.x series.
22
+ This package targets and is tested with version 23.0.0 or later in the 23.x series.
23
23
 
24
24
  ## Support Scope
25
25
 
26
26
  This fork maintains only full parsing: valid input yields a correct tree, and invalid input yields `ERROR` or `MISSING`
27
- nodes without crashing, hanging, or taking more than linear time. Incremental parsing works as in upstream tree-sitter
28
- but is not tested here, and no queries (highlights, locals, injections, tags) are shipped. Node types, field names, and
29
- the trees that error recovery produces may change; such changes are released as new major versions.
27
+ nodes without crashing, hanging, or taking more than linear time. Incremental parsing is not supported, and no queries
28
+ (highlights, locals, injections, tags) are shipped. Node types, field names, and the trees that error recovery produces
29
+ may change; such changes are released as new major versions.
30
30
 
31
31
  ## Usage
32
32
 
33
33
  The npm package ships `tree-sitter-embedded_template.wasm` for
34
- [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 19.1.1 or later in the 19.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers.
34
+ [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 23.0.0 or later in the 23.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers.
35
35
  In Node.js and Bun, load the grammar from its path:
36
36
 
37
37
  ```js
@@ -80,7 +80,7 @@ In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-
80
80
  fuzzed with:
81
81
 
82
82
  ```sh
83
- cargo add willbooster-tree-sitter@19.1.1 --rename tree-sitter
83
+ cargo add willbooster-tree-sitter@23.0.0 --rename tree-sitter
84
84
  cargo add willbooster-tree-sitter-embedded-template --rename tree-sitter-embedded-template
85
85
  ```
86
86
 
@@ -122,8 +122,7 @@ and the release build regenerate the parsers before compiling them.
122
122
  `script/parse-examples`. After a grammar change or a moved pin alters that list, `script/parse-examples` rewrites it;
123
123
  review its diff before committing;
124
124
  - performance checks (`test/unit/performance.test.ts`) that templates ending in an unclosed directive or containing
125
- long runs of delimiter prefix characters parse in linear time and that generated character-scanning lexer loops hoist
126
- token marking outside the per-byte loop. It loads the Wasm build through
125
+ long runs of delimiter prefix characters parse in linear time. It loads the Wasm build through
127
126
  @willbooster/web-tree-sitter, which `bun run build/ci` rebuilds after regenerating the parser;
128
127
  - a check (`test/unit/runtimeVersion.test.ts`) that `@willbooster/web-tree-sitter` in `package.json` and
129
128
  `willbooster-tree-sitter` in `Cargo.lock` are the same version, since the Wasm tests run on the former and the Rust
package/grammar.js CHANGED
@@ -21,9 +21,9 @@ module.exports = grammar({
21
21
  $.content,
22
22
  )),
23
23
 
24
- // Keep pure `[^%=_-]+` and `[^<]*` tails outside any outer `(...)+` so the generated lexer loops have no outgoing
25
- // transitions to non-accepting states (avoiding per-byte `mark_end` calls), and bound delimiter prefixes (`[=_-]{1,3}`
26
- // and `<`) so fallback before `%>`, `<%`, or EOF stays linear.
24
+ // Keep pure `[^%=_-]+` and `[^<]*` tails outside any outer `(...)+` so their DFA states stay self-loops in
25
+ // `ts_lex_table` (allowing the runtime lexer to scan runs before recording acceptance), and bound delimiter
26
+ // prefixes (`[=_-]{1,3}` and `<`) so fallback before `%>`, `<%`, or EOF stays linear.
27
27
  code: _ => repeat1(choice(/[^%=_-]+|[=_-]{1,3}[^%=_-]+|%[^>%=_-][^%=_-]*|[%=_-]/, '%%>')),
28
28
 
29
29
  content: _ => prec.right(repeat1(choice(/[^<]+|<([^<%][^<]*)?/, '<%%'))),
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-embedded-template",
3
- "version": "10.0.0",
3
+ "version": "12.0.0",
4
4
  "description": "Embedded template (ERB, EJS) grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "embedded-template",
7
- "incremental",
8
7
  "parsing",
9
8
  "tree-sitter"
10
9
  ],
@@ -46,21 +45,21 @@
46
45
  "devDependencies": {
47
46
  "@tsconfig/bun": "1.0.11",
48
47
  "@types/bun": "1.4.4",
49
- "@vitest/browser-playwright": "5.0.5",
48
+ "@vitest/browser-playwright": "5.1.0",
50
49
  "@willbooster/oxlint-config": "1.4.9",
51
- "@willbooster/wb": "23.3.0",
52
- "@willbooster/web-tree-sitter": "19.1.1",
50
+ "@willbooster/wb": "23.3.4",
51
+ "@willbooster/web-tree-sitter": "23.0.0",
53
52
  "conventional-changelog-conventionalcommits": "10.4.1",
54
53
  "lefthook": "2.2.2",
55
- "oxlint": "1.90.0",
56
- "oxlint-tsgolint": "7.0.2005",
57
- "playwright": "1.64.1",
54
+ "oxlint": "1.92.0",
55
+ "oxlint-tsgolint": "7.0.2006",
56
+ "playwright": "1.65.0",
58
57
  "semantic-release": "25.0.9",
59
- "vitest": "5.0.5",
58
+ "vitest": "5.1.0",
60
59
  "wrangler": "4.156.0"
61
60
  },
62
61
  "peerDependencies": {
63
- "@willbooster/web-tree-sitter": "^19.1.1"
62
+ "@willbooster/web-tree-sitter": "^23.0.0"
64
63
  },
65
64
  "peerDependenciesMeta": {
66
65
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -43,7 +43,7 @@
43
43
  }
44
44
  ],
45
45
  "metadata": {
46
- "version": "10.0.0",
46
+ "version": "12.0.0",
47
47
  "license": "MIT",
48
48
  "description": "Embedded template (ERB, EJS) grammar for tree-sitter",
49
49
  "authors": [