parseman 0.50.1 → 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.
Files changed (53) hide show
  1. package/README.md +14 -10
  2. package/dist/analysis/diagnostics.js +431 -219
  3. package/dist/analysis/diagnostics.js.map +3 -3
  4. package/dist/cli/index.js +421 -184
  5. package/dist/cli/index.js.map +3 -3
  6. package/dist/combinators/choice.d.ts.map +1 -1
  7. package/dist/combinators/grammar.d.ts.map +1 -1
  8. package/dist/combinators/keywords.d.ts.map +1 -1
  9. package/dist/combinators/literal.d.ts.map +1 -1
  10. package/dist/combinators/map.d.ts.map +1 -1
  11. package/dist/combinators/ref.d.ts.map +1 -1
  12. package/dist/combinators/regex.d.ts.map +1 -1
  13. package/dist/combinators/repeat.d.ts.map +1 -1
  14. package/dist/combinators/scalar.d.ts +6 -0
  15. package/dist/combinators/scalar.d.ts.map +1 -0
  16. package/dist/combinators/sequence.d.ts.map +1 -1
  17. package/dist/combinators/trivia-skip.d.ts +2 -0
  18. package/dist/combinators/trivia-skip.d.ts.map +1 -1
  19. package/dist/compiler/token-capability.js +0 -3
  20. package/dist/compiler/token-capability.js.map +2 -2
  21. package/dist/index.js +422 -185
  22. package/dist/index.js.map +3 -3
  23. package/dist/language-service/index.js +68 -172
  24. package/dist/language-service/index.js.map +3 -3
  25. package/dist/parse-context.d.ts.map +1 -1
  26. package/dist/plugin/index.js +467 -299
  27. package/dist/plugin/index.js.map +3 -3
  28. package/dist/run/index.js +1 -0
  29. package/dist/run/index.js.map +1 -1
  30. package/dist/spec/index.js +399 -277
  31. package/dist/spec/index.js.map +3 -3
  32. package/dist/table/emit-assembly.d.ts.map +1 -1
  33. package/dist/table/index.js +307 -181
  34. package/dist/table/index.js.map +3 -3
  35. package/dist/types.d.ts +8 -0
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/version.d.ts +1 -1
  38. package/package.json +4 -2
  39. package/src/combinators/choice.ts +34 -1
  40. package/src/combinators/grammar.ts +39 -0
  41. package/src/combinators/keywords.ts +14 -3
  42. package/src/combinators/literal.ts +26 -0
  43. package/src/combinators/map.ts +60 -0
  44. package/src/combinators/ref.ts +26 -7
  45. package/src/combinators/regex.ts +23 -0
  46. package/src/combinators/repeat.ts +109 -16
  47. package/src/combinators/scalar.ts +30 -0
  48. package/src/combinators/sequence.ts +76 -161
  49. package/src/combinators/trivia-skip.ts +14 -1
  50. package/src/parse-context.ts +1 -0
  51. package/src/table/emit-assembly.ts +39 -16
  52. package/src/types.ts +8 -0
  53. 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 **188 µs**; Peggy takes 323 µs. Only a purpose-built native
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
  ![GraphQL parsing benchmarks](https://raw.githubusercontent.com/matthew-dean/parseman/main/assets/bench-graphql.svg)
21
21
 
22
- Two more results. The compiled CST path beats Lezer on the JSON CST fixture — **242 µs** vs
23
- 570 µs at 11.9 kB — while producing a richer tree carrying spans and trivia. And `parseDoc`
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 **188 µs** vs Peggy's 323 µs, JSON **223 µs** vs Chevrotain's 238 µs, CSV
164
- **114 µs** vs Peggy's 422 µs. Native `JSON.parse` does JSON large in 50.3 µs. On the CST
165
- chart, runtime compile runs 242 µs against Lezer's 570 µs parse-only.
166
-
167
- Those are the committed 0.48.0 charts, regenerated on 2026-08-14 on an M4 Pro with
168
- Node 25.9.0. They include the restored small rows for JSON, CSV, GraphQL, and CST.
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
  ![JSON parsing benchmarks](https://raw.githubusercontent.com/matthew-dean/parseman/main/assets/bench-json.svg)
171
175