parseman 0.50.0 → 0.50.3
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 +14 -10
- package/dist/analysis/diagnostics.js +455 -226
- package/dist/analysis/diagnostics.js.map +3 -3
- package/dist/cli/index.js +445 -191
- package/dist/cli/index.js.map +3 -3
- package/dist/combinators/choice.d.ts.map +1 -1
- package/dist/combinators/grammar.d.ts.map +1 -1
- package/dist/combinators/keywords.d.ts.map +1 -1
- package/dist/combinators/literal.d.ts.map +1 -1
- package/dist/combinators/map.d.ts.map +1 -1
- package/dist/combinators/ref.d.ts.map +1 -1
- package/dist/combinators/regex.d.ts.map +1 -1
- package/dist/combinators/repeat.d.ts.map +1 -1
- package/dist/combinators/scalar.d.ts +6 -0
- package/dist/combinators/scalar.d.ts.map +1 -0
- package/dist/combinators/sequence.d.ts.map +1 -1
- package/dist/combinators/trivia-skip.d.ts +2 -0
- package/dist/combinators/trivia-skip.d.ts.map +1 -1
- package/dist/compiler/token-capability.js +0 -3
- package/dist/compiler/token-capability.js.map +2 -2
- package/dist/index.js +446 -192
- package/dist/index.js.map +3 -3
- package/dist/language-service/index.js +68 -172
- package/dist/language-service/index.js.map +3 -3
- package/dist/parse-context.d.ts.map +1 -1
- package/dist/plugin/index.js +491 -306
- package/dist/plugin/index.js.map +3 -3
- package/dist/run/index.js +1 -0
- package/dist/run/index.js.map +1 -1
- package/dist/spec/index.js +399 -277
- package/dist/spec/index.js.map +3 -3
- package/dist/table/emit-assembly.d.ts.map +1 -1
- package/dist/table/encode.d.ts.map +1 -1
- package/dist/table/index.js +331 -188
- package/dist/table/index.js.map +3 -3
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -2
- package/src/combinators/choice.ts +34 -1
- package/src/combinators/grammar.ts +39 -0
- package/src/combinators/keywords.ts +14 -3
- package/src/combinators/literal.ts +26 -0
- package/src/combinators/map.ts +60 -0
- package/src/combinators/ref.ts +26 -7
- package/src/combinators/regex.ts +23 -0
- package/src/combinators/repeat.ts +109 -16
- package/src/combinators/scalar.ts +30 -0
- package/src/combinators/sequence.ts +76 -161
- package/src/combinators/trivia-skip.ts +14 -1
- package/src/parse-context.ts +1 -0
- package/src/table/emit-assembly.ts +39 -16
- package/src/table/encode.ts +30 -10
- package/src/types.ts +8 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -14,13 +14,15 @@ library with an optional compiler, and it gives you both.
|
|
|
14
14
|
parser in the suite** — ahead of every other library measured, at every grammar and every
|
|
15
15
|
input size in that suite.
|
|
16
16
|
Every parser in the suite builds real output: objects, row arrays, AST nodes. On a 7.7 kB
|
|
17
|
-
GraphQL document Parséman takes **
|
|
18
|
-
edges it out: `JSON.parse` on JSON.
|
|
17
|
+
GraphQL document compiled Parséman takes **148 µs**; Chevrotain takes 336 µs. Only a
|
|
18
|
+
purpose-built native edges it out: `JSON.parse` on JSON.
|
|
19
19
|
|
|
20
20
|

|
|
21
21
|
|
|
22
|
-
Two more results. The
|
|
23
|
-
|
|
22
|
+
Two more results. The setup-free interpreter now leads every external parser at every
|
|
23
|
+
measured JSON, CSV, and GraphQL size. The compiled CST path beats Lezer on the JSON CST
|
|
24
|
+
fixture — **148 µs** vs 583 µs at 11.9 kB — while producing a richer tree carrying spans
|
|
25
|
+
and trivia. And `parseDoc`
|
|
24
26
|
stores parent-relative spans, so an in-place edit costs a fraction of a full reparse rather
|
|
25
27
|
than a multiple of it. Results move with grammar shape, input size and runtime — which is
|
|
26
28
|
why [the suite](#benchmarks) ships with the library rather than only its conclusions.
|
|
@@ -160,12 +162,14 @@ Benchmarked against [Peggy](https://peggyjs.org/),
|
|
|
160
162
|
Each chart's legend names the libraries measured for that grammar.
|
|
161
163
|
|
|
162
164
|
Largest fixture of each, runtime compile against the fastest other library on that chart:
|
|
163
|
-
GraphQL **
|
|
164
|
-
**
|
|
165
|
-
chart, runtime compile runs
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
GraphQL **147.76 µs** vs Chevrotain's 335.75 µs, JSON **122.09 µs** vs Chevrotain's
|
|
166
|
+
242.86 µs, CSV **75.02 µs** vs Peggy's 433.52 µs. Native `JSON.parse` does JSON large
|
|
167
|
+
in 40.61 µs. On the CST chart, runtime compile runs 151.87 µs against Lezer's 582.14 µs
|
|
168
|
+
parse-only.
|
|
169
|
+
|
|
170
|
+
Those are the committed 0.50.2 charts, regenerated on 2026-08-29 on an M4 Pro with
|
|
171
|
+
Node 24.11.1. They include small, medium, and large rows for JSON, GraphQL, and CST,
|
|
172
|
+
plus small and large CSV rows.
|
|
169
173
|
|
|
170
174
|

|
|
171
175
|
|