parseman 0.51.2 → 0.52.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/dist/analysis/commitment.d.ts.map +1 -1
- package/dist/analysis/diagnostics.js +53 -20
- package/dist/analysis/diagnostics.js.map +1 -1
- package/dist/cli/index.js +53 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/combinators/attempt.d.ts +11 -1
- package/dist/combinators/attempt.d.ts.map +1 -1
- package/dist/combinators/map.d.ts.map +1 -1
- package/dist/combinators/node.d.ts +6 -2
- package/dist/combinators/node.d.ts.map +1 -1
- package/dist/compiler/token-capability.js +4 -0
- package/dist/compiler/token-capability.js.map +1 -1
- package/dist/cst/trivia-kinds.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -22
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.js +55 -22
- package/dist/plugin/index.js.map +1 -1
- package/dist/spec/index.js +28 -5
- package/dist/spec/index.js.map +1 -1
- package/dist/table/assemble.d.ts.map +1 -1
- package/dist/table/emit-assembly.d.ts.map +1 -1
- package/dist/table/encode-baseline.d.ts.map +1 -1
- package/dist/table/exec.d.ts.map +1 -1
- package/dist/table/index.js +37 -15
- package/dist/table/index.js.map +1 -1
- package/dist/table/ops.d.ts +7 -5
- package/dist/table/ops.d.ts.map +1 -1
- package/dist/table/site-labels.d.ts.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/analysis/commitment.ts +3 -1
- package/src/analysis/rebuild.ts +1 -1
- package/src/combinators/attempt.ts +26 -3
- package/src/combinators/first-set.ts +5 -1
- package/src/combinators/map.ts +5 -1
- package/src/combinators/node.ts +12 -3
- package/src/compiler/ir-serialize.ts +1 -1
- package/src/coverage.ts +1 -1
- package/src/cst/trivia-kinds.ts +6 -0
- package/src/index.ts +1 -0
- package/src/plugin/evaluator.ts +1 -1
- package/src/table/assemble.ts +22 -8
- package/src/table/emit-assembly.ts +8 -3
- package/src/table/encode-baseline.ts +5 -1
- package/src/table/encode.ts +13 -13
- package/src/table/exec.ts +6 -2
- package/src/table/ops.ts +7 -5
- package/src/table/site-labels.ts +3 -1
- package/src/types.ts +8 -1
- package/src/version.ts +1 -1
package/src/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { LabeledTriviaSpec } from './cst/trivia-kinds.ts'
|
|
2
|
+
|
|
1
3
|
export type Span = {
|
|
2
4
|
start: number
|
|
3
5
|
end: number
|
|
@@ -56,7 +58,7 @@ export type ParserDef =
|
|
|
56
58
|
// closures live in `gates`.
|
|
57
59
|
| { tag: 'choice'; parsers: Combinator<unknown>[]; gates: (((state: unknown) => boolean) | null)[]; gateSrcs?: (string | null)[]; disjoint: boolean; strategy: ChoiceStrategy; autoNot: (AutoNotCheck[] | null)[] }
|
|
58
60
|
| { tag: 'dispatch'; selector: Combinator<string>; cases: readonly DispatchCase[]; matchers?: readonly DispatchMatcherCase[] | undefined; otherwise?: Combinator<unknown> | undefined; otherwiseUsesRouted?: boolean | undefined }
|
|
59
|
-
| { tag: 'attempt'; parser: Combinator<unknown
|
|
61
|
+
| { tag: 'attempt'; parser: Combinator<unknown>; /** `attempt(p, { contain: true })`: a committed failure inside is reported uncommitted. */ contain?: true }
|
|
60
62
|
// The TAG carries NULLABILITY (what every downstream switch keys on): `many` is
|
|
61
63
|
// the nullable min-0 repeat, `oneOrMore` the non-nullable min>=1 one. `min`/`max`
|
|
62
64
|
// carry the actual ITEM bounds (`many(x, { min: 3, max: 8 })` is a `oneOrMore`
|
|
@@ -433,6 +435,11 @@ export type ParserMeta = {
|
|
|
433
435
|
isTrivia: boolean
|
|
434
436
|
/** User-defined labels for labeled trivia arms (`label(name, parser)`). */
|
|
435
437
|
triviaKindLabels?: readonly string[]
|
|
438
|
+
/**
|
|
439
|
+
* Set only by `trivia()`: the labeled-arm spec of this trivia (`null` when it is
|
|
440
|
+
* not labeled), built once so a labeled scan never re-derives it.
|
|
441
|
+
*/
|
|
442
|
+
labeledTriviaSpec?: LabeledTriviaSpec | null
|
|
436
443
|
/** Preclassified lightweight trivia scanner for the ordinary skip path. */
|
|
437
444
|
triviaScanner?: ((input: string, cur: number) => number) | null
|
|
438
445
|
/** Set only by `classifiedTrivia()`: each root-visible category is a separate
|
package/src/version.ts
CHANGED