@optique/core 1.0.0-dev.1728 → 1.0.0-dev.1732

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.
@@ -4481,7 +4481,6 @@ function conditional(discriminator, branches, defaultBranch, options) {
4481
4481
  const runtime = require_dependency_runtime.createDependencyRuntimeContext(exec?.dependencyRegistry?.clone());
4482
4482
  await require_dependency_runtime.collectExplicitSourceValuesAsync(require_dependency_runtime.buildRuntimeNodesFromPairs([["_discriminator", discriminator], ["_branch", branchParser]], combinedState, exec?.path), runtime);
4483
4483
  require_dependency_runtime.collectSourcesFromState(combinedState, runtime);
4484
- const resolvedBranchState = getAnnotatedChildState(state, await require_dependency_runtime.resolveStateWithRuntimeAsync(state.branchState, runtime), branchParser);
4485
4484
  const completionExec = {
4486
4485
  ...exec ?? {
4487
4486
  usage: branchParser.usage,
@@ -4523,6 +4522,7 @@ function conditional(discriminator, branches, defaultBranch, options) {
4523
4522
  error: options?.errors?.branchMismatch ? options.errors.branchMismatch(resolvedKey, speculativeKey) : require_message.message`Branch mismatch: tokens for ${speculativeKey} were consumed, but the discriminator resolved to ${resolvedKey}.`
4524
4523
  };
4525
4524
  }
4525
+ const resolvedBranchState = getAnnotatedChildState(state, await require_dependency_runtime.resolveStateWithRuntimeAsync(state.branchState, runtime), branchParser);
4526
4526
  const branchResult = unwrapCompleteResult(await branchParser.complete(resolvedBranchState, withChildExecPath(completionExec, "_branch")));
4527
4527
  if (!branchResult.success) {
4528
4528
  if (discriminatorValue !== void 0 && options?.errors?.branchError) return {
@@ -4481,7 +4481,6 @@ function conditional(discriminator, branches, defaultBranch, options) {
4481
4481
  const runtime = createDependencyRuntimeContext(exec?.dependencyRegistry?.clone());
4482
4482
  await collectExplicitSourceValuesAsync(buildRuntimeNodesFromPairs([["_discriminator", discriminator], ["_branch", branchParser]], combinedState, exec?.path), runtime);
4483
4483
  collectSourcesFromState(combinedState, runtime);
4484
- const resolvedBranchState = getAnnotatedChildState(state, await resolveStateWithRuntimeAsync(state.branchState, runtime), branchParser);
4485
4484
  const completionExec = {
4486
4485
  ...exec ?? {
4487
4486
  usage: branchParser.usage,
@@ -4523,6 +4522,7 @@ function conditional(discriminator, branches, defaultBranch, options) {
4523
4522
  error: options?.errors?.branchMismatch ? options.errors.branchMismatch(resolvedKey, speculativeKey) : message`Branch mismatch: tokens for ${speculativeKey} were consumed, but the discriminator resolved to ${resolvedKey}.`
4524
4523
  };
4525
4524
  }
4525
+ const resolvedBranchState = getAnnotatedChildState(state, await resolveStateWithRuntimeAsync(state.branchState, runtime), branchParser);
4526
4526
  const branchResult = unwrapCompleteResult(await branchParser.complete(resolvedBranchState, withChildExecPath(completionExec, "_branch")));
4527
4527
  if (!branchResult.success) {
4528
4528
  if (discriminatorValue !== void 0 && options?.errors?.branchError) return {
package/dist/parser.d.cts CHANGED
@@ -571,11 +571,14 @@ type ParserResult<TState> = {
571
571
  * marker stays set across subsequent parse calls until
572
572
  * `complete()` verifies the speculative selection.
573
573
  *
574
- * Outer combinators like {@link or} and {@link longestMatch} should
575
- * not treat provisional successes as definitive a definitive
576
- * branch must be allowed to take priority, and a definitive
574
+ * Outer combinators should not treat provisional successes as
575
+ * definitive. For example, {@link or} should still allow a
576
+ * definitive branch to take priority, and a definitive
577
577
  * zero-consuming fallback must not be displaced by a provisional
578
- * consuming hit.
578
+ * consuming hit. {@link longestMatch} may still prefer a longer
579
+ * provisional match over a shorter definitive one; when match
580
+ * lengths are equal, definitive results take priority over
581
+ * provisional ones.
579
582
  *
580
583
  * @since 1.0.0
581
584
  */
package/dist/parser.d.ts CHANGED
@@ -571,11 +571,14 @@ type ParserResult<TState> = {
571
571
  * marker stays set across subsequent parse calls until
572
572
  * `complete()` verifies the speculative selection.
573
573
  *
574
- * Outer combinators like {@link or} and {@link longestMatch} should
575
- * not treat provisional successes as definitive a definitive
576
- * branch must be allowed to take priority, and a definitive
574
+ * Outer combinators should not treat provisional successes as
575
+ * definitive. For example, {@link or} should still allow a
576
+ * definitive branch to take priority, and a definitive
577
577
  * zero-consuming fallback must not be displaced by a provisional
578
- * consuming hit.
578
+ * consuming hit. {@link longestMatch} may still prefer a longer
579
+ * provisional match over a shorter definitive one; when match
580
+ * lengths are equal, definitive results take priority over
581
+ * provisional ones.
579
582
  *
580
583
  * @since 1.0.0
581
584
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1728+5206d2c9",
3
+ "version": "1.0.0-dev.1732+7850e4bf",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",