parseman 0.10.0 → 0.11.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.
Files changed (2) hide show
  1. package/README.md +3 -3
  2. package/package.json +5 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Parséman (PAR-zə-mahn)
6
6
 
7
- Write parsers in TypeScript — fast enough to run as-is, and blazing fast when the bundler macro kicks in. Same code either way; no grammar files, no generated output to check in. Drop the plugin in tests or anywhere a bundler isn't around and everything still works.
7
+ Write parsers in TypeScript — fast enough to run as-is, and blazing fast when the bundler macro kicks in. Same grammar either way; no grammar files, no generated output to check in. Drop the plugin in tests or anywhere a bundler isn't around and everything still works.
8
8
 
9
9
  > **📖 Full documentation: [matthew-dean.github.io/parseman](https://matthew-dean.github.io/parseman/)**
10
10
 
@@ -66,13 +66,13 @@ Full API in the **[reference](https://matthew-dean.github.io/parseman/reference/
66
66
 
67
67
  ## Benchmarks
68
68
 
69
- **When parsing to JS values** — objects, row arrays, AST nodes — **Parséman's macro build is the fastest general-purpose JS parser we benchmark**, beating Peggy, Parsimmon, Chevrotain, Nearley, and Jison at every grammar and size. The only thing that edges it out is a purpose-built native like `JSON.parse`; for anything that *doesn't* have a built-in, Parséman is the one to beat.
69
+ **When parsing to JS values** — objects, row arrays, AST nodes — **Parséman's macro build is the fastest general-purpose JS parser we benchmark**, beating [Peggy](https://peggyjs.org/), [Parsimmon](https://github.com/jneen/parsimmon), [Chevrotain](https://chevrotain.io/), [Nearley](https://nearley.js.org/), and [Jison](https://github.com/zaach/jison) at every grammar and size. The only thing that edges it out is a purpose-built native like `JSON.parse`; for anything that *doesn't* have a built-in, Parséman is the one to beat.
70
70
 
71
71
  For **syntax tree building**, the compiled CST path (macro build) beats [Lezer](https://lezer.codemirror.net/) on the JSON CST fixture too — while producing a richer object tree with spans and trivia. For **incremental re-parse**, the two trade places by edit type: Parséman's `makeFunctionalDoc` is ~300× faster than a full reparse on in-place value edits (and ahead of Lezer), while Lezer's buffer reuse wins on structural edits. Full breakdown in the [benchmarks guide](https://matthew-dean.github.io/parseman/guide/benchmarks).
72
72
 
73
73
  Measured on Apple M2 Pro. Bars show µs per parse — shorter is faster. Refresh: `pnpm bench`, then `pnpm bench:svg` (updates `assets/bench-*.svg`).
74
74
 
75
- Compared parsers: **Parséman**, Peggy, Parsimmon, Chevrotain, Nearley, and Jison (plus `JSON.parse` on JSON). Each implements the same parsing work on the bench fixtures — building JS values / row arrays / GraphQL AST nodes, not syntax-only validation. Peggy grammars in `bench/*.pegjs` are the reference; Nearley JSON uses [kach/nearley `examples/json.ne`](https://github.com/kach/nearley/blob/master/examples/json.ne); other Nearley and Jison grammars are ports of those Peggy files (`bench/vendor/`).
75
+ Compared parsers: **Parséman**, [Peggy](https://peggyjs.org/), [Parsimmon](https://github.com/jneen/parsimmon), [Chevrotain](https://chevrotain.io/), [Nearley](https://nearley.js.org/), and [Jison](https://github.com/zaach/jison) (plus `JSON.parse` on JSON). Each implements the same parsing work on the bench fixtures — building JS values / row arrays / GraphQL AST nodes, not syntax-only validation. Peggy grammars in `bench/*.pegjs` are the reference; Nearley JSON uses [kach/nearley `examples/json.ne`](https://github.com/kach/nearley/blob/master/examples/json.ne); other Nearley and Jison grammars are ports of those Peggy files (`bench/vendor/`).
76
76
 
77
77
  ![JSON parsing benchmarks](https://raw.githubusercontent.com/matthew-dean/parseman/main/assets/bench-json.svg)
78
78
 
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "parseman",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
+ "packageManager": "pnpm@10.15.1",
4
5
  "description": "Parser combinators that compile to optimized JavaScript — use as a library or as a build-time macro",
5
6
  "type": "module",
6
7
  "author": "Matthew Dean <matthew-dean@users.noreply.github.com>",
@@ -44,6 +45,7 @@
44
45
  "docs:preview": "vitepress preview docs",
45
46
  "bench:svg": "node --import tsx/esm bench/gen-svg.ts",
46
47
  "bench:size": "node --import tsx/esm bench/measure-expansion.ts",
48
+ "docs:favicons": "node scripts/gen-favicons.mjs",
47
49
  "build:chevrotain-bench": "node --import tsx/esm scripts/build-chevrotain-bench.mjs",
48
50
  "bench:compile-grammars": "peggy --format es -o bench/json-parser.js bench/json.pegjs && peggy --format es -o bench/csv-parser.js bench/csv.pegjs && peggy --format es -o bench/graphql-parser.js bench/graphql.pegjs && nearleyc bench/vendor/nearley/json.ne -o bench/json-nearley.cjs && nearleyc bench/vendor/nearley/csv.ne -o bench/csv-nearley.cjs && nearleyc bench/vendor/nearley/graphql.ne -o bench/graphql-nearley.cjs && node bench/compile-jison.mjs"
49
51
  },
@@ -63,6 +65,8 @@
63
65
  "@types/parsimmon": "~1.10.9",
64
66
  "chevrotain": "~12.0.0",
65
67
  "esbuild": "~0.27.7",
68
+ "favicons": "~7.3.0",
69
+ "sharp": "~0.34.5",
66
70
  "jison": "~0.4.18",
67
71
  "moo": "~0.5.3",
68
72
  "nearley": "~2.20.1",