parseman 0.51.0 → 0.51.2

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 (48) hide show
  1. package/dist/analysis/diagnostics.js +48 -15
  2. package/dist/analysis/diagnostics.js.map +1 -1
  3. package/dist/cli/index.js +50 -17
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/combinators/token.d.ts +8 -8
  6. package/dist/combinators/token.d.ts.map +1 -1
  7. package/dist/coverage.d.ts.map +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +59 -21
  11. package/dist/index.js.map +1 -1
  12. package/dist/plugin/evaluator.d.ts.map +1 -1
  13. package/dist/plugin/index.js +59 -22
  14. package/dist/plugin/index.js.map +1 -1
  15. package/dist/spec/index.js +27 -5
  16. package/dist/spec/index.js.map +1 -1
  17. package/dist/table/assemble.d.ts.map +1 -1
  18. package/dist/table/emit-assembly.d.ts.map +1 -1
  19. package/dist/table/encode-baseline.d.ts.map +1 -1
  20. package/dist/table/exec-baseline.d.ts.map +1 -1
  21. package/dist/table/exec.d.ts.map +1 -1
  22. package/dist/table/index.js +373 -362
  23. package/dist/table/index.js.map +2 -2
  24. package/dist/table/ops.d.ts +2 -0
  25. package/dist/table/ops.d.ts.map +1 -1
  26. package/dist/types.d.ts +1 -0
  27. package/dist/types.d.ts.map +1 -1
  28. package/dist/version.d.ts +1 -1
  29. package/package.json +1 -1
  30. package/src/analysis/duplication.ts +1 -1
  31. package/src/analysis/rebuild.ts +2 -2
  32. package/src/combinators/token.ts +46 -3
  33. package/src/compiler/ir-serialize.ts +11 -7
  34. package/src/coverage.ts +2 -3
  35. package/src/index.ts +1 -1
  36. package/src/plugin/evaluator.ts +7 -4
  37. package/src/table/assemble.ts +8 -3
  38. package/src/table/child-slots.ts +2 -2
  39. package/src/table/emit-assembly.ts +5 -3
  40. package/src/table/encode-baseline.ts +3 -2
  41. package/src/table/encode.ts +3 -3
  42. package/src/table/exec-baseline.ts +30 -4
  43. package/src/table/exec.ts +8 -3
  44. package/src/table/ops.ts +3 -1
  45. package/src/table/scalar-terminal.ts +5 -5
  46. package/src/table/site-labels.ts +2 -2
  47. package/src/types.ts +1 -1
  48. package/src/version.ts +1 -1
@@ -60,7 +60,7 @@
60
60
  * label licenses at a leaf is dropping the TEST — never the capture.
61
61
  */
62
62
  import {
63
- OP_ATTEMPT, OP_CHOICE, OP_DISPATCH, OP_EXPECT, OP_FIELD, OP_GATE, OP_LABEL, OP_LEAF,
63
+ OP_ATTEMPT, OP_CHOICE, OP_DISPATCH, OP_EXPECT, OP_FIELD, OP_GATE, OP_LABEL, OP_LEAF, OP_SOURCE_LEAF,
64
64
  OP_NODE, OP_NODE_TRACK, OP_NOT, OP_OPT, OP_PEEK, OP_REP, OP_REPV, OP_ROUTED, OP_RULE,
65
65
  OP_SCOPE, OP_SCOPE_CAP, OP_SCOPE_PLAIN, OP_SEQ, OP_SEQV, OP_SEQX, OP_TOKEN, OP_XFORM,
66
66
  } from './ops.ts'
@@ -193,7 +193,7 @@ function transfer(code: Int32Array, ip: number, at: SiteLabel, hostCst: boolean)
193
193
  if (at.tri === TRI_NONE && !at.buf) return at
194
194
  return { tri: TRI_NONE, buf: false, raw: RAW_UNKNOWN, cap: at.cap }
195
195
  }
196
- if (op === OP_LEAF) {
196
+ if (op === OP_LEAF || op === OP_SOURCE_LEAF) {
197
197
  if (!at.buf) return at
198
198
  return { tri: at.tri, buf: false, raw: RAW_UNKNOWN, cap: at.cap }
199
199
  }
package/src/types.ts CHANGED
@@ -79,7 +79,7 @@ export type ParserDef =
79
79
  // selector matched). It exists so ONE production can serve both contexts instead of
80
80
  // being spelled twice — a `routed()` twin and a concrete-lead original.
81
81
  | { tag: 'routed'; fallback?: Combinator<unknown> }
82
- | { tag: 'leaf'; parser: Combinator<unknown>; fn: (v: unknown, span: { start: number; end: number }) => unknown; fnSrc?: string }
82
+ | { tag: 'leaf'; parser: Combinator<unknown>; fn: (v: unknown, span: { start: number; end: number }) => unknown; fnSrc?: string; cstValue?: 'source' }
83
83
  | { tag: 'label'; label: string; parser: Combinator<unknown> }
84
84
  | { tag: 'field'; name: string; parser: Combinator<unknown> }
85
85
  | { tag: 'grammar'; parser: Combinator<unknown>; triviaParser: Combinator<unknown> | undefined; clearTrivia?: boolean; captureTrivia?: boolean; rootCapture?: 'opaque'; trackLines: boolean; constructionTrackLines?: 'on' | 'off' | 'inherit'; constructionCaptureTriviaKinds?: readonly string[] }
package/src/version.ts CHANGED
@@ -13,4 +13,4 @@
13
13
  * Kept in sync with `package.json` by `test/unit/version-sync.test.ts`, which fails
14
14
  * the build if this constant drifts from the published version.
15
15
  */
16
- export const PARSEMAN_VERSION = '0.51.0'
16
+ export const PARSEMAN_VERSION = '0.51.2'