@optique/core 1.4.0-dev.2619 → 1.4.0-dev.2622
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/constructs.cjs +87 -146
- package/dist/constructs.js +87 -146
- package/dist/execution-context.cjs +1 -2
- package/dist/execution-context.js +1 -3
- package/dist/extension.cjs +0 -15
- package/dist/extension.d.cts +1 -12
- package/dist/extension.d.ts +1 -12
- package/dist/extension.js +1 -15
- package/dist/facade.cjs +140 -6
- package/dist/facade.d.cts +32 -2
- package/dist/facade.d.ts +32 -2
- package/dist/facade.js +141 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/modifiers.cjs +4 -5
- package/dist/modifiers.js +4 -5
- package/dist/primitives.cjs +27 -69
- package/dist/primitives.d.cts +3 -3
- package/dist/primitives.d.ts +3 -3
- package/dist/primitives.js +27 -69
- package/dist/usage-internals.cjs +0 -73
- package/dist/usage-internals.js +1 -71
- package/package.json +2 -2
- package/skills/optique/SKILL.md +12 -12
- package/dist/short-option.cjs +0 -311
- package/dist/short-option.js +0 -297
package/dist/constructs.cjs
CHANGED
|
@@ -8,13 +8,12 @@ const require_internal_dependency = require('./internal/dependency.cjs');
|
|
|
8
8
|
const require_dependency_runtime = require('./dependency-runtime.cjs');
|
|
9
9
|
const require_internal_parser = require('./internal/parser.cjs');
|
|
10
10
|
const require_annotation_state = require('./annotation-state.cjs');
|
|
11
|
-
const require_execution_context = require('./execution-context.cjs');
|
|
12
|
-
const require_usage_internals = require('./usage-internals.cjs');
|
|
13
|
-
const require_short_option = require('./short-option.cjs');
|
|
14
11
|
const require_command_alias = require('./internal/command-alias.cjs');
|
|
12
|
+
const require_execution_context = require('./execution-context.cjs');
|
|
15
13
|
const require_phase2_seed = require('./phase2-seed.cjs');
|
|
16
14
|
const require_modifiers = require('./modifiers.cjs');
|
|
17
15
|
const require_suggestion = require('./suggestion.cjs');
|
|
16
|
+
const require_usage_internals = require('./usage-internals.cjs');
|
|
18
17
|
|
|
19
18
|
//#region src/constructs.ts
|
|
20
19
|
/**
|
|
@@ -49,8 +48,7 @@ function withoutRepublishInstruction(exec) {
|
|
|
49
48
|
}
|
|
50
49
|
function withChildContext$1(context, segment, state, parser, usage) {
|
|
51
50
|
const childState = parser == null ? state : require_annotation_state.getWrappedChildParseState(context.state, state, parser);
|
|
52
|
-
|
|
53
|
-
return parser == null ? child : require_short_option.withParserOptionScope(child, parser);
|
|
51
|
+
return require_execution_context.withChildContext(context, segment, childState, usage);
|
|
54
52
|
}
|
|
55
53
|
function isUnmatchedDependencyState(state, parser) {
|
|
56
54
|
if (state === void 0) return true;
|
|
@@ -1404,7 +1402,7 @@ function or(...args) {
|
|
|
1404
1402
|
let optionsTerminatorResult = null;
|
|
1405
1403
|
let provisionalAmbiguous = false;
|
|
1406
1404
|
for (const [parser, i] of orderedParsers) {
|
|
1407
|
-
const result = parser.parse(withChildContext$1(
|
|
1405
|
+
const result = parser.parse(withChildContext$1(context, i, activeState == null || activeState[0] !== i || !activeState[1].success ? parser.initialState : activeState[1].next.state, parser));
|
|
1408
1406
|
if (isOptionsTerminatorOnlyResult(context, result)) {
|
|
1409
1407
|
if (activeState?.[0] === i && activeState[1].success && activeState[1].consumed.length > 0 && result.next.buffer.length < 1) return preserveExclusiveStateAfterOptionsTerminator(context, result);
|
|
1410
1408
|
optionsTerminatorResult ??= result;
|
|
@@ -1439,7 +1437,7 @@ function or(...args) {
|
|
|
1439
1437
|
return {
|
|
1440
1438
|
success: true,
|
|
1441
1439
|
next: {
|
|
1442
|
-
...
|
|
1440
|
+
...context,
|
|
1443
1441
|
buffer: result.next.buffer,
|
|
1444
1442
|
optionsTerminated: result.next.optionsTerminated,
|
|
1445
1443
|
state: createExclusiveState(context.state, i, parser, result),
|
|
@@ -1475,7 +1473,7 @@ function or(...args) {
|
|
|
1475
1473
|
return {
|
|
1476
1474
|
success: true,
|
|
1477
1475
|
next: {
|
|
1478
|
-
...
|
|
1476
|
+
...context,
|
|
1479
1477
|
buffer: replayedResult.next.buffer,
|
|
1480
1478
|
optionsTerminated: replayedResult.next.optionsTerminated,
|
|
1481
1479
|
state: createExclusiveState(context.state, i, parser, {
|
|
@@ -1494,7 +1492,7 @@ function or(...args) {
|
|
|
1494
1492
|
return {
|
|
1495
1493
|
success: true,
|
|
1496
1494
|
next: {
|
|
1497
|
-
...
|
|
1495
|
+
...context,
|
|
1498
1496
|
buffer: result.next.buffer,
|
|
1499
1497
|
optionsTerminated: result.next.optionsTerminated,
|
|
1500
1498
|
state: createExclusiveState(context.state, i, parser, result),
|
|
@@ -1520,7 +1518,7 @@ function or(...args) {
|
|
|
1520
1518
|
success: true,
|
|
1521
1519
|
...zeroConsumedBranch.result.provisional ? { provisional: true } : {},
|
|
1522
1520
|
next: {
|
|
1523
|
-
...
|
|
1521
|
+
...context,
|
|
1524
1522
|
state: createExclusiveState(context.state, zeroConsumedBranch.index, zeroConsumedBranch.parser, zeroConsumedBranch.result),
|
|
1525
1523
|
...mergedExec != null ? {
|
|
1526
1524
|
exec: mergedExec,
|
|
@@ -1538,7 +1536,7 @@ function or(...args) {
|
|
|
1538
1536
|
success: true,
|
|
1539
1537
|
provisional: true,
|
|
1540
1538
|
next: {
|
|
1541
|
-
...
|
|
1539
|
+
...context,
|
|
1542
1540
|
buffer: provisionalConsuming.result.next.buffer,
|
|
1543
1541
|
optionsTerminated: provisionalConsuming.result.next.optionsTerminated,
|
|
1544
1542
|
state: createExclusiveState(context.state, provisionalConsuming.index, provisionalConsuming.parser, provisionalConsuming.result),
|
|
@@ -1553,7 +1551,7 @@ function or(...args) {
|
|
|
1553
1551
|
if (activeState != null && activeState[1].success) {
|
|
1554
1552
|
const previouslyConsumed = activeState[1].consumed;
|
|
1555
1553
|
const checkResult = provisionalConsuming.parser.parse({
|
|
1556
|
-
...withChildContext$1(
|
|
1554
|
+
...withChildContext$1(context, provisionalConsuming.index, provisionalConsuming.parser.initialState, provisionalConsuming.parser),
|
|
1557
1555
|
buffer: previouslyConsumed
|
|
1558
1556
|
});
|
|
1559
1557
|
const canConsumeShared = checkResult.success && checkResult.consumed.length === previouslyConsumed.length && checkResult.consumed.every((c, idx) => c === previouslyConsumed[idx]);
|
|
@@ -1572,7 +1570,7 @@ function or(...args) {
|
|
|
1572
1570
|
success: true,
|
|
1573
1571
|
provisional: true,
|
|
1574
1572
|
next: {
|
|
1575
|
-
...
|
|
1573
|
+
...context,
|
|
1576
1574
|
buffer: replayedResult.next.buffer,
|
|
1577
1575
|
optionsTerminated: replayedResult.next.optionsTerminated,
|
|
1578
1576
|
state: createExclusiveState(context.state, provisionalConsuming.index, provisionalConsuming.parser, {
|
|
@@ -1607,7 +1605,7 @@ function or(...args) {
|
|
|
1607
1605
|
let optionsTerminatorResult = null;
|
|
1608
1606
|
let provisionalAmbiguous = false;
|
|
1609
1607
|
for (const [parser, i] of orderedParsers) {
|
|
1610
|
-
const resultOrPromise = parser.parse(withChildContext$1(
|
|
1608
|
+
const resultOrPromise = parser.parse(withChildContext$1(context, i, activeState == null || activeState[0] !== i || !activeState[1].success ? parser.initialState : activeState[1].next.state, parser));
|
|
1611
1609
|
const result = await resultOrPromise;
|
|
1612
1610
|
if (isOptionsTerminatorOnlyResult(context, result)) {
|
|
1613
1611
|
if (activeState?.[0] === i && activeState[1].success && activeState[1].consumed.length > 0 && result.next.buffer.length < 1) return preserveExclusiveStateAfterOptionsTerminator(context, result);
|
|
@@ -1643,7 +1641,7 @@ function or(...args) {
|
|
|
1643
1641
|
return {
|
|
1644
1642
|
success: true,
|
|
1645
1643
|
next: {
|
|
1646
|
-
...
|
|
1644
|
+
...context,
|
|
1647
1645
|
buffer: result.next.buffer,
|
|
1648
1646
|
optionsTerminated: result.next.optionsTerminated,
|
|
1649
1647
|
state: createExclusiveState(context.state, i, parser, result),
|
|
@@ -1681,7 +1679,7 @@ function or(...args) {
|
|
|
1681
1679
|
return {
|
|
1682
1680
|
success: true,
|
|
1683
1681
|
next: {
|
|
1684
|
-
...
|
|
1682
|
+
...context,
|
|
1685
1683
|
buffer: replayedResult.next.buffer,
|
|
1686
1684
|
optionsTerminated: replayedResult.next.optionsTerminated,
|
|
1687
1685
|
state: createExclusiveState(context.state, i, parser, {
|
|
@@ -1700,7 +1698,7 @@ function or(...args) {
|
|
|
1700
1698
|
return {
|
|
1701
1699
|
success: true,
|
|
1702
1700
|
next: {
|
|
1703
|
-
...
|
|
1701
|
+
...context,
|
|
1704
1702
|
buffer: result.next.buffer,
|
|
1705
1703
|
optionsTerminated: result.next.optionsTerminated,
|
|
1706
1704
|
state: createExclusiveState(context.state, i, parser, result),
|
|
@@ -1726,7 +1724,7 @@ function or(...args) {
|
|
|
1726
1724
|
success: true,
|
|
1727
1725
|
...zeroConsumedBranch.result.provisional ? { provisional: true } : {},
|
|
1728
1726
|
next: {
|
|
1729
|
-
...
|
|
1727
|
+
...context,
|
|
1730
1728
|
state: createExclusiveState(context.state, zeroConsumedBranch.index, zeroConsumedBranch.parser, zeroConsumedBranch.result),
|
|
1731
1729
|
...mergedExec != null ? {
|
|
1732
1730
|
exec: mergedExec,
|
|
@@ -1744,7 +1742,7 @@ function or(...args) {
|
|
|
1744
1742
|
success: true,
|
|
1745
1743
|
provisional: true,
|
|
1746
1744
|
next: {
|
|
1747
|
-
...
|
|
1745
|
+
...context,
|
|
1748
1746
|
buffer: provisionalConsuming.result.next.buffer,
|
|
1749
1747
|
optionsTerminated: provisionalConsuming.result.next.optionsTerminated,
|
|
1750
1748
|
state: createExclusiveState(context.state, provisionalConsuming.index, provisionalConsuming.parser, provisionalConsuming.result),
|
|
@@ -1759,7 +1757,7 @@ function or(...args) {
|
|
|
1759
1757
|
if (activeState != null && activeState[1].success) {
|
|
1760
1758
|
const previouslyConsumed = activeState[1].consumed;
|
|
1761
1759
|
const checkResult = await provisionalConsuming.parser.parse({
|
|
1762
|
-
...withChildContext$1(
|
|
1760
|
+
...withChildContext$1(context, provisionalConsuming.index, provisionalConsuming.parser.initialState, provisionalConsuming.parser),
|
|
1763
1761
|
buffer: previouslyConsumed
|
|
1764
1762
|
});
|
|
1765
1763
|
const canConsumeShared = checkResult.success && checkResult.consumed.length === previouslyConsumed.length && checkResult.consumed.every((c, idx) => c === previouslyConsumed[idx]);
|
|
@@ -1778,7 +1776,7 @@ function or(...args) {
|
|
|
1778
1776
|
success: true,
|
|
1779
1777
|
provisional: true,
|
|
1780
1778
|
next: {
|
|
1781
|
-
...
|
|
1779
|
+
...context,
|
|
1782
1780
|
buffer: replayedResult.next.buffer,
|
|
1783
1781
|
optionsTerminated: replayedResult.next.optionsTerminated,
|
|
1784
1782
|
state: createExclusiveState(context.state, provisionalConsuming.index, provisionalConsuming.parser, {
|
|
@@ -1865,7 +1863,7 @@ function or(...args) {
|
|
|
1865
1863
|
if (singleDependencyMetadata != null) singleResult.dependencyMetadata = singleDependencyMetadata;
|
|
1866
1864
|
defineExclusiveSchedulingNodes(singleResult, parsers);
|
|
1867
1865
|
require_internal_parser.defineInheritedAnnotationParser(singleResult);
|
|
1868
|
-
return require_modifiers.fluent(
|
|
1866
|
+
return require_modifiers.fluent(singleResult);
|
|
1869
1867
|
}
|
|
1870
1868
|
/**
|
|
1871
1869
|
* @since 0.5.0
|
|
@@ -1914,7 +1912,7 @@ function createLongestMatch(...args) {
|
|
|
1914
1912
|
return {
|
|
1915
1913
|
success: true,
|
|
1916
1914
|
next: {
|
|
1917
|
-
...
|
|
1915
|
+
...context,
|
|
1918
1916
|
buffer: selectedResult.next.buffer,
|
|
1919
1917
|
optionsTerminated: selectedResult.next.optionsTerminated,
|
|
1920
1918
|
state: createExclusiveState(context.state, match.index, parser, selectedResult),
|
|
@@ -1954,7 +1952,7 @@ function createLongestMatch(...args) {
|
|
|
1954
1952
|
const activeState = normalizeExclusiveState(context.state);
|
|
1955
1953
|
for (let i = 0; i < syncParsers.length; i++) {
|
|
1956
1954
|
const parser = syncParsers[i];
|
|
1957
|
-
const childContext = withChildContext$1(
|
|
1955
|
+
const childContext = withChildContext$1(context, i, activeState == null || activeState[0] !== i || !activeState[1].success ? parser.initialState : activeState[1].next.state, parser);
|
|
1958
1956
|
const result = parser.parse(childContext);
|
|
1959
1957
|
if (isOptionsTerminatorOnlyResult(context, result)) {
|
|
1960
1958
|
optionsTerminatorMatches.push({
|
|
@@ -1990,7 +1988,7 @@ function createLongestMatch(...args) {
|
|
|
1990
1988
|
const activeState = normalizeExclusiveState(context.state);
|
|
1991
1989
|
for (let i = 0; i < parsers.length; i++) {
|
|
1992
1990
|
const parser = parsers[i];
|
|
1993
|
-
const childContext = withChildContext$1(
|
|
1991
|
+
const childContext = withChildContext$1(context, i, activeState == null || activeState[0] !== i || !activeState[1].success ? parser.initialState : activeState[1].next.state, parser);
|
|
1994
1992
|
const resultOrPromise = parser.parse(childContext);
|
|
1995
1993
|
const result = await resultOrPromise;
|
|
1996
1994
|
if (isOptionsTerminatorOnlyResult(context, result)) {
|
|
@@ -2081,7 +2079,7 @@ function createLongestMatch(...args) {
|
|
|
2081
2079
|
if (multiDependencyMetadata != null) multiResult.dependencyMetadata = multiDependencyMetadata;
|
|
2082
2080
|
defineExclusiveSchedulingNodes(multiResult, parsers);
|
|
2083
2081
|
require_internal_parser.defineInheritedAnnotationParser(multiResult);
|
|
2084
|
-
return require_modifiers.fluent(
|
|
2082
|
+
return require_modifiers.fluent(multiResult);
|
|
2085
2083
|
}
|
|
2086
2084
|
/**
|
|
2087
2085
|
* Creates the initial parse error shared by object-like combinators.
|
|
@@ -2524,7 +2522,6 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
2524
2522
|
next: context,
|
|
2525
2523
|
consumed: []
|
|
2526
2524
|
};
|
|
2527
|
-
require_short_option.adoptOptionScope(context, result.next);
|
|
2528
2525
|
const mergedExec = require_execution_context.mergeChildExec(context.exec, result.next.exec);
|
|
2529
2526
|
const nextState = result.next.state === fieldState ? context.state : {
|
|
2530
2527
|
...context.state,
|
|
@@ -2556,10 +2553,10 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
2556
2553
|
parse(context) {
|
|
2557
2554
|
const fieldState = createFieldStateGetter(context.state, getObjectParseChildState)(field, parser);
|
|
2558
2555
|
return require_mode_dispatch.dispatchByMode(combinedMode, () => {
|
|
2559
|
-
const result = parser.parse(withChildContext$1(
|
|
2556
|
+
const result = parser.parse(withChildContext$1(context, field, fieldState, parser));
|
|
2560
2557
|
return adaptFieldLaneResult(context, field, parser, fieldState, result);
|
|
2561
2558
|
}, async () => {
|
|
2562
|
-
const result = await parser.parse(withChildContext$1(
|
|
2559
|
+
const result = await parser.parse(withChildContext$1(context, field, fieldState, parser));
|
|
2563
2560
|
return adaptFieldLaneResult(context, field, parser, fieldState, result);
|
|
2564
2561
|
});
|
|
2565
2562
|
}
|
|
@@ -2575,9 +2572,8 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
2575
2572
|
madeProgress = false;
|
|
2576
2573
|
const getFieldState = createFieldStateGetter(currentContext.state, getObjectParseChildState);
|
|
2577
2574
|
for (const [field, parser] of parserPairs) {
|
|
2578
|
-
const result = parser.parse(withChildContext$1(
|
|
2575
|
+
const result = parser.parse(withChildContext$1(currentContext, field, getFieldState(field, parser), parser));
|
|
2579
2576
|
if (result.success && result.consumed.length > 0) {
|
|
2580
|
-
require_short_option.adoptOptionScope(currentContext, result.next);
|
|
2581
2577
|
const mergedExec = require_execution_context.mergeChildExec(currentContext.exec, result.next.exec);
|
|
2582
2578
|
currentContext = {
|
|
2583
2579
|
...currentContext,
|
|
@@ -2608,9 +2604,8 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
2608
2604
|
const typedParser = parser;
|
|
2609
2605
|
if (parser.leadingNames.size > 0 || typedParser.acceptingAnyToken) continue;
|
|
2610
2606
|
const fieldState = getFieldState(field, parser);
|
|
2611
|
-
const result = typedParser.parse(withChildContext$1(
|
|
2607
|
+
const result = typedParser.parse(withChildContext$1(currentContext, field, fieldState, parser));
|
|
2612
2608
|
if (result.success && result.consumed.length === 0 && result.next.state !== fieldState) {
|
|
2613
|
-
require_short_option.adoptOptionScope(currentContext, result.next);
|
|
2614
2609
|
const mergedExec = require_execution_context.mergeChildExec(currentContext.exec, result.next.exec);
|
|
2615
2610
|
currentContext = {
|
|
2616
2611
|
...currentContext,
|
|
@@ -2683,10 +2678,9 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
2683
2678
|
madeProgress = false;
|
|
2684
2679
|
const getFieldState = createFieldStateGetter(currentContext.state, getObjectParseChildState);
|
|
2685
2680
|
for (const [field, parser] of parserPairs) {
|
|
2686
|
-
const resultOrPromise = parser.parse(withChildContext$1(
|
|
2681
|
+
const resultOrPromise = parser.parse(withChildContext$1(currentContext, field, getFieldState(field, parser), parser));
|
|
2687
2682
|
const result = await resultOrPromise;
|
|
2688
2683
|
if (result.success && result.consumed.length > 0) {
|
|
2689
|
-
require_short_option.adoptOptionScope(currentContext, result.next);
|
|
2690
2684
|
const mergedExec = require_execution_context.mergeChildExec(currentContext.exec, result.next.exec);
|
|
2691
2685
|
currentContext = {
|
|
2692
2686
|
...currentContext,
|
|
@@ -2716,10 +2710,9 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
2716
2710
|
if (consumedFields.has(field)) continue;
|
|
2717
2711
|
if (parser.leadingNames.size > 0 || parser.acceptingAnyToken) continue;
|
|
2718
2712
|
const fieldState = getFieldState(field, parser);
|
|
2719
|
-
const resultOrPromise = parser.parse(withChildContext$1(
|
|
2713
|
+
const resultOrPromise = parser.parse(withChildContext$1(currentContext, field, fieldState, parser));
|
|
2720
2714
|
const result = await resultOrPromise;
|
|
2721
2715
|
if (result.success && result.consumed.length === 0 && result.next.state !== fieldState) {
|
|
2722
|
-
require_short_option.adoptOptionScope(currentContext, result.next);
|
|
2723
2716
|
const mergedExec = require_execution_context.mergeChildExec(currentContext.exec, result.next.exec);
|
|
2724
2717
|
currentContext = {
|
|
2725
2718
|
...currentContext,
|
|
@@ -3100,15 +3093,15 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
3100
3093
|
});
|
|
3101
3094
|
require_internal_parser.defineParseLanes(objectParser, objectParseLanes);
|
|
3102
3095
|
require_internal_parser.defineInheritedAnnotationParser(objectParser);
|
|
3103
|
-
return require_modifiers.fluent(
|
|
3096
|
+
return require_modifiers.fluent(objectParser);
|
|
3104
3097
|
}
|
|
3105
3098
|
function isParserLike(value) {
|
|
3106
3099
|
return value != null && (typeof value === "object" || typeof value === "function") && "parse" in value && "$valueType" in value && "$stateType" in value;
|
|
3107
3100
|
}
|
|
3108
3101
|
function tokenMatchesLeadingName(token, candidates) {
|
|
3109
3102
|
if (token == null) return false;
|
|
3110
|
-
for (const name of candidates.optionNames) if (token === name
|
|
3111
|
-
for (const name of candidates.joinedOptionNames) if (
|
|
3103
|
+
for (const name of candidates.optionNames) if (token === name) return true;
|
|
3104
|
+
for (const name of candidates.joinedOptionNames) if (name.startsWith("/") && token.startsWith(`${name}:`) || (name.startsWith("--") || name.startsWith("-") && name.length > 2) && token.startsWith(`${name}=`)) return true;
|
|
3112
3105
|
for (const name of candidates.commandNames) if (token === name) return true;
|
|
3113
3106
|
return false;
|
|
3114
3107
|
}
|
|
@@ -3334,7 +3327,6 @@ function advanceSeqSuggestContextSync(context, parsers, initialStates) {
|
|
|
3334
3327
|
while (currentContext.state.index < parsers.length) {
|
|
3335
3328
|
const index = currentContext.state.index;
|
|
3336
3329
|
const parser = parsers[index];
|
|
3337
|
-
currentContext = require_short_option.withParserOptionScope(currentContext, parser, index);
|
|
3338
3330
|
const parserState = getSeqChildState(currentContext.state, index, parser);
|
|
3339
3331
|
if (currentContext.buffer.length < 1) break;
|
|
3340
3332
|
if (shouldAdvanceSeqBeforeParse(parser, parserState, initialStates[index], currentContext, index, parsers)) {
|
|
@@ -3361,7 +3353,6 @@ async function advanceSeqSuggestContextAsync(context, parsers, initialStates) {
|
|
|
3361
3353
|
while (currentContext.state.index < parsers.length) {
|
|
3362
3354
|
const index = currentContext.state.index;
|
|
3363
3355
|
const parser = parsers[index];
|
|
3364
|
-
currentContext = require_short_option.withParserOptionScope(currentContext, parser, index);
|
|
3365
3356
|
const parserState = getSeqChildState(currentContext.state, index, parser);
|
|
3366
3357
|
if (currentContext.buffer.length < 1) break;
|
|
3367
3358
|
if (shouldAdvanceSeqBeforeParse(parser, parserState, initialStates[index], currentContext, index, parsers)) {
|
|
@@ -4118,7 +4109,7 @@ function tuple(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
4118
4109
|
enumerable: false
|
|
4119
4110
|
});
|
|
4120
4111
|
require_internal_parser.defineInheritedAnnotationParser(tupleParser);
|
|
4121
|
-
return require_modifiers.fluent(
|
|
4112
|
+
return require_modifiers.fluent(tupleParser);
|
|
4122
4113
|
}
|
|
4123
4114
|
function seq(...rawArgs) {
|
|
4124
4115
|
const label = typeof rawArgs[0] === "string" ? rawArgs[0] : void 0;
|
|
@@ -4136,30 +4127,12 @@ function seq(...rawArgs) {
|
|
|
4136
4127
|
...result,
|
|
4137
4128
|
consumed: consumed.length + result.consumed
|
|
4138
4129
|
});
|
|
4139
|
-
const reachableSeqScope = (context) => {
|
|
4140
|
-
let end = Math.min(context.state.index + 1, parsers.length);
|
|
4141
|
-
while (end < parsers.length) {
|
|
4142
|
-
const index = end - 1;
|
|
4143
|
-
const child = parsers[index];
|
|
4144
|
-
if (context.buffer.length > 0 && !tokenMatchesLeadingName(context.buffer[0], leadingCandidatesAfter(parsers, end))) break;
|
|
4145
|
-
if (!parserCanSkipAt(child, getSeqChildState(context.state, index, child), context.exec, index)) break;
|
|
4146
|
-
end++;
|
|
4147
|
-
}
|
|
4148
|
-
return require_short_option.combinedOptionScope(parsers.slice(0, end), parsers.slice(0, end).map((_, index) => index));
|
|
4149
|
-
};
|
|
4150
|
-
const seqScope = require_short_option.selectableOptionScope(reachableSeqScope({
|
|
4151
|
-
state: initialState,
|
|
4152
|
-
buffer: [],
|
|
4153
|
-
usage: [],
|
|
4154
|
-
optionsTerminated: false
|
|
4155
|
-
}));
|
|
4156
4130
|
const parseSync = (context) => {
|
|
4157
4131
|
let currentContext = context;
|
|
4158
4132
|
const allConsumed = [];
|
|
4159
4133
|
while (currentContext.state.index < syncParsers.length) {
|
|
4160
4134
|
const index = currentContext.state.index;
|
|
4161
4135
|
const parser = syncParsers[index];
|
|
4162
|
-
seqScope.select(currentContext, reachableSeqScope(currentContext));
|
|
4163
4136
|
const parserState = getSeqChildState(currentContext.state, index, parser);
|
|
4164
4137
|
if (currentContext.buffer.length < 1) break;
|
|
4165
4138
|
if (shouldAdvanceSeqBeforeParse(parser, parserState, initialState.states[index], currentContext, index, syncParsers)) {
|
|
@@ -4168,14 +4141,13 @@ function seq(...rawArgs) {
|
|
|
4168
4141
|
currentContext = advanceSeqContext(currentContext, index + 1, consumedTerminator);
|
|
4169
4142
|
continue;
|
|
4170
4143
|
}
|
|
4171
|
-
const result = parser.parse(withChildContext$1(
|
|
4144
|
+
const result = parser.parse(withChildContext$1(currentContext, index, parserState, parser));
|
|
4172
4145
|
if (!result.success) {
|
|
4173
4146
|
if (result.consumed > 0) return withSeqConsumedDepth(result, allConsumed);
|
|
4174
4147
|
if (!parserCanSkipAt(parser, parserState, currentContext.exec, index)) return withSeqConsumedDepth(result, allConsumed);
|
|
4175
4148
|
currentContext = advanceSeqContext(currentContext, index + 1, false);
|
|
4176
4149
|
continue;
|
|
4177
4150
|
}
|
|
4178
|
-
require_short_option.adoptOptionScope(currentContext, result.next);
|
|
4179
4151
|
const states = updateSeqChildState(currentContext.state, index, result.next.state, parser);
|
|
4180
4152
|
const nextIndex = result.consumed.length > 0 ? index : index + 1;
|
|
4181
4153
|
const mergedExec = require_execution_context.mergeChildExec(currentContext.exec, result.next.exec);
|
|
@@ -4203,7 +4175,6 @@ function seq(...rawArgs) {
|
|
|
4203
4175
|
while (currentContext.state.index < parsers.length) {
|
|
4204
4176
|
const index = currentContext.state.index;
|
|
4205
4177
|
const parser = parsers[index];
|
|
4206
|
-
seqScope.select(currentContext, reachableSeqScope(currentContext));
|
|
4207
4178
|
const parserState = getSeqChildState(currentContext.state, index, parser);
|
|
4208
4179
|
if (currentContext.buffer.length < 1) break;
|
|
4209
4180
|
if (shouldAdvanceSeqBeforeParse(parser, parserState, initialState.states[index], currentContext, index, parsers)) {
|
|
@@ -4212,14 +4183,13 @@ function seq(...rawArgs) {
|
|
|
4212
4183
|
currentContext = advanceSeqContext(currentContext, index + 1, consumedTerminator);
|
|
4213
4184
|
continue;
|
|
4214
4185
|
}
|
|
4215
|
-
const result = await parser.parse(withChildContext$1(
|
|
4186
|
+
const result = await parser.parse(withChildContext$1(currentContext, index, parserState, parser));
|
|
4216
4187
|
if (!result.success) {
|
|
4217
4188
|
if (result.consumed > 0) return withSeqConsumedDepth(result, allConsumed);
|
|
4218
4189
|
if (!parserCanSkipAt(parser, parserState, currentContext.exec, index)) return withSeqConsumedDepth(result, allConsumed);
|
|
4219
4190
|
currentContext = advanceSeqContext(currentContext, index + 1, false);
|
|
4220
4191
|
continue;
|
|
4221
4192
|
}
|
|
4222
|
-
require_short_option.adoptOptionScope(currentContext, result.next);
|
|
4223
4193
|
const states = updateSeqChildState(currentContext.state, index, result.next.state, parser);
|
|
4224
4194
|
const nextIndex = result.consumed.length > 0 ? index : index + 1;
|
|
4225
4195
|
const mergedExec = require_execution_context.mergeChildExec(currentContext.exec, result.next.exec);
|
|
@@ -4473,9 +4443,7 @@ function seq(...rawArgs) {
|
|
|
4473
4443
|
enumerable: false
|
|
4474
4444
|
});
|
|
4475
4445
|
require_internal_parser.defineInheritedAnnotationParser(seqParser);
|
|
4476
|
-
return require_modifiers.fluent(
|
|
4477
|
-
seqScope.select(context, reachableSeqScope(context));
|
|
4478
|
-
}, true));
|
|
4446
|
+
return require_modifiers.fluent(seqParser);
|
|
4479
4447
|
}
|
|
4480
4448
|
function merge(...args) {
|
|
4481
4449
|
const label = typeof args[0] === "string" ? args[0] : void 0;
|
|
@@ -5469,7 +5437,7 @@ function merge(...args) {
|
|
|
5469
5437
|
};
|
|
5470
5438
|
require_internal_parser.defineParseLanes(mergeParser, mergeParseLanes);
|
|
5471
5439
|
require_internal_parser.defineInheritedAnnotationParser(mergeParser);
|
|
5472
|
-
return require_modifiers.fluent(
|
|
5440
|
+
return require_modifiers.fluent(mergeParser);
|
|
5473
5441
|
}
|
|
5474
5442
|
/**
|
|
5475
5443
|
* Builds a dependency registry from the pre-parsed context state and returns
|
|
@@ -6096,7 +6064,7 @@ function concat(...parsers) {
|
|
|
6096
6064
|
}
|
|
6097
6065
|
};
|
|
6098
6066
|
require_internal_parser.defineInheritedAnnotationParser(concatParser);
|
|
6099
|
-
return require_modifiers.fluent(
|
|
6067
|
+
return require_modifiers.fluent(concatParser);
|
|
6100
6068
|
}
|
|
6101
6069
|
function group(label, parser, options = {}) {
|
|
6102
6070
|
require_validate.validateLabel(label);
|
|
@@ -6206,7 +6174,7 @@ function group(label, parser, options = {}) {
|
|
|
6206
6174
|
configurable: true,
|
|
6207
6175
|
enumerable: false
|
|
6208
6176
|
});
|
|
6209
|
-
return require_modifiers.fluent(
|
|
6177
|
+
return require_modifiers.fluent(groupParser);
|
|
6210
6178
|
}
|
|
6211
6179
|
/**
|
|
6212
6180
|
* Creates a conditional parser that selects different branch parsers based on
|
|
@@ -6315,7 +6283,6 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6315
6283
|
const noMatchContext = analyzeNoMatchContext([discriminator, ...allBranchParsers]);
|
|
6316
6284
|
return options?.errors?.noMatch ? typeof options.errors.noMatch === "function" ? options.errors.noMatch(noMatchContext) : options.errors.noMatch : generateNoMatchError(noMatchContext);
|
|
6317
6285
|
};
|
|
6318
|
-
const optionScope = require_short_option.conditionalOptionScope(discriminator, defaultBranch, branchParsers.map(([, p]) => p));
|
|
6319
6286
|
const parseSync = (context) => {
|
|
6320
6287
|
const state = context.state ?? initialState;
|
|
6321
6288
|
const syncDiscriminator = discriminator;
|
|
@@ -6352,12 +6319,10 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6352
6319
|
const value = completionResult.value;
|
|
6353
6320
|
const branchParser = syncBranches[value];
|
|
6354
6321
|
if (branchParser) {
|
|
6355
|
-
const branchContext = require_short_option.forkOptionScope(context);
|
|
6356
|
-
optionScope.select(branchContext, branchParser);
|
|
6357
6322
|
const discriminatorExec = require_execution_context.mergeChildExec(context.exec, discriminatorResult.next.exec);
|
|
6358
6323
|
const branchParseResult = branchParser.parse({
|
|
6359
6324
|
...withChildContext$1({
|
|
6360
|
-
...
|
|
6325
|
+
...context,
|
|
6361
6326
|
...discriminatorExec != null ? {
|
|
6362
6327
|
exec: discriminatorExec,
|
|
6363
6328
|
dependencyRegistry: discriminatorExec.dependencyRegistry
|
|
@@ -6367,7 +6332,6 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6367
6332
|
optionsTerminated: discriminatorResult.next.optionsTerminated
|
|
6368
6333
|
});
|
|
6369
6334
|
if (branchParseResult.success) {
|
|
6370
|
-
if (discriminatorResult.consumed.length > 0 || branchParseResult.consumed.length > 0) require_short_option.adoptOptionScope(context, branchParseResult.next);
|
|
6371
6335
|
const mergedExec = require_execution_context.mergeChildExec(discriminatorExec, branchParseResult.next.exec);
|
|
6372
6336
|
const isProvisional = branchParseResult.provisional || discriminatorResult.consumed.length === 0 && branchParseResult.consumed.length === 0 && (branchParser.leadingNames.size > 0 || branchParser.acceptingAnyToken);
|
|
6373
6337
|
return {
|
|
@@ -6392,29 +6356,26 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6392
6356
|
consumed: [...discriminatorResult.consumed, ...branchParseResult.consumed]
|
|
6393
6357
|
};
|
|
6394
6358
|
}
|
|
6395
|
-
if (discriminatorResult.consumed.length > 0) {
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
kind: "branch",
|
|
6406
|
-
key: value
|
|
6407
|
-
},
|
|
6408
|
-
branchState: require_annotation_state.getWrappedChildState(state, branchParser.initialState, branchParser)
|
|
6359
|
+
if (discriminatorResult.consumed.length > 0) return {
|
|
6360
|
+
success: true,
|
|
6361
|
+
next: {
|
|
6362
|
+
...discriminatorResult.next,
|
|
6363
|
+
state: {
|
|
6364
|
+
discriminatorState: annotatedDiscriminatorState,
|
|
6365
|
+
discriminatorValue: value,
|
|
6366
|
+
selectedBranch: {
|
|
6367
|
+
kind: "branch",
|
|
6368
|
+
key: value
|
|
6409
6369
|
},
|
|
6410
|
-
|
|
6411
|
-
exec: discriminatorExec,
|
|
6412
|
-
dependencyRegistry: discriminatorExec.dependencyRegistry
|
|
6413
|
-
} : {}
|
|
6370
|
+
branchState: require_annotation_state.getWrappedChildState(state, branchParser.initialState, branchParser)
|
|
6414
6371
|
},
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6372
|
+
...discriminatorExec != null ? {
|
|
6373
|
+
exec: discriminatorExec,
|
|
6374
|
+
dependencyRegistry: discriminatorExec.dependencyRegistry
|
|
6375
|
+
} : {}
|
|
6376
|
+
},
|
|
6377
|
+
consumed: discriminatorResult.consumed
|
|
6378
|
+
};
|
|
6418
6379
|
return branchParseResult;
|
|
6419
6380
|
}
|
|
6420
6381
|
}
|
|
@@ -6430,7 +6391,6 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6430
6391
|
if (defaultResult.success && (defaultResult.consumed.length > 0 || discriminatorConsumed === 0 && context.buffer.length === 0)) {
|
|
6431
6392
|
const mergedExec = require_execution_context.mergeChildExec(context.exec, defaultResult.next.exec);
|
|
6432
6393
|
const commitDefault = defaultResult.consumed.length > 0 || context.buffer.length === 0;
|
|
6433
|
-
if (commitDefault) optionScope.select(context, syncDefaultBranch);
|
|
6434
6394
|
return {
|
|
6435
6395
|
success: true,
|
|
6436
6396
|
...defaultResult.provisional ? { provisional: true } : {},
|
|
@@ -6488,7 +6448,7 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6488
6448
|
if (discriminatorResult.consumed.length === 0 && discriminator.mode === "async") {
|
|
6489
6449
|
const discriminatorExec = require_execution_context.mergeChildExec(context.exec, discriminatorResult.next.exec);
|
|
6490
6450
|
const speculationContext = {
|
|
6491
|
-
...
|
|
6451
|
+
...context,
|
|
6492
6452
|
buffer: discriminatorResult.next.buffer,
|
|
6493
6453
|
optionsTerminated: discriminatorResult.next.optionsTerminated,
|
|
6494
6454
|
...discriminatorExec != null ? {
|
|
@@ -6502,7 +6462,7 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6502
6462
|
let speculativeError;
|
|
6503
6463
|
let ambiguous = false;
|
|
6504
6464
|
for (const [key, bp] of branchParsers) {
|
|
6505
|
-
const branchResult = await bp.parse(withChildContext$1(
|
|
6465
|
+
const branchResult = await bp.parse(withChildContext$1(speculationContext, "_branch", bp.initialState, bp, bp.usage));
|
|
6506
6466
|
if (branchResult.success && branchResult.consumed.length > 0) {
|
|
6507
6467
|
if (branchResult.provisional) {
|
|
6508
6468
|
if (provisionalHit == null && !provisionalAmbiguous) provisionalHit = {
|
|
@@ -6535,12 +6495,11 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6535
6495
|
if (branchResult.success) {
|
|
6536
6496
|
const annotatedDiscriminatorState$2 = require_annotation_state.getWrappedChildState(state, discriminatorResult.next.state, discriminator);
|
|
6537
6497
|
const mergedExec = require_execution_context.mergeChildExec(discriminatorExec, branchResult.next.exec);
|
|
6538
|
-
optionScope.select(context, bp);
|
|
6539
6498
|
return {
|
|
6540
6499
|
success: true,
|
|
6541
6500
|
provisional: true,
|
|
6542
6501
|
next: {
|
|
6543
|
-
...
|
|
6502
|
+
...branchResult.next,
|
|
6544
6503
|
state: {
|
|
6545
6504
|
...state,
|
|
6546
6505
|
discriminatorState: annotatedDiscriminatorState$2,
|
|
@@ -6562,15 +6521,14 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6562
6521
|
}
|
|
6563
6522
|
let deferredBranchState = state.branchState;
|
|
6564
6523
|
if (defaultBranch !== void 0 && !ambiguous && !provisionalAmbiguous) {
|
|
6565
|
-
const defaultResult = await defaultBranch.parse(withChildContext$1(
|
|
6524
|
+
const defaultResult = await defaultBranch.parse(withChildContext$1(speculationContext, "_branch", state.branchState ?? defaultBranch.initialState, defaultBranch, defaultBranch.usage));
|
|
6566
6525
|
if (defaultResult.success && defaultResult.consumed.length > 0) {
|
|
6567
6526
|
const defaultExec = require_execution_context.mergeChildExec(discriminatorExec ?? context.exec, defaultResult.next.exec);
|
|
6568
|
-
optionScope.select(context, defaultBranch);
|
|
6569
6527
|
return {
|
|
6570
6528
|
success: true,
|
|
6571
6529
|
...defaultResult.provisional ? { provisional: true } : {},
|
|
6572
6530
|
next: {
|
|
6573
|
-
...
|
|
6531
|
+
...defaultResult.next,
|
|
6574
6532
|
state: {
|
|
6575
6533
|
...state,
|
|
6576
6534
|
selectedBranch: { kind: "default" },
|
|
@@ -6593,7 +6551,7 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6593
6551
|
success: true,
|
|
6594
6552
|
provisional: true,
|
|
6595
6553
|
next: {
|
|
6596
|
-
...
|
|
6554
|
+
...speculationContext,
|
|
6597
6555
|
state: {
|
|
6598
6556
|
...state,
|
|
6599
6557
|
discriminatorState: annotatedDiscriminatorState$1,
|
|
@@ -6609,12 +6567,10 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6609
6567
|
const value = completionResult.value;
|
|
6610
6568
|
const branchParser = branches[value];
|
|
6611
6569
|
if (branchParser) {
|
|
6612
|
-
const branchContext = require_short_option.forkOptionScope(context);
|
|
6613
|
-
optionScope.select(branchContext, branchParser);
|
|
6614
6570
|
const discriminatorExec = require_execution_context.mergeChildExec(context.exec, discriminatorResult.next.exec);
|
|
6615
6571
|
const branchParseResult = await branchParser.parse({
|
|
6616
6572
|
...withChildContext$1({
|
|
6617
|
-
...
|
|
6573
|
+
...context,
|
|
6618
6574
|
...discriminatorExec != null ? {
|
|
6619
6575
|
exec: discriminatorExec,
|
|
6620
6576
|
dependencyRegistry: discriminatorExec.dependencyRegistry
|
|
@@ -6624,7 +6580,6 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6624
6580
|
optionsTerminated: discriminatorResult.next.optionsTerminated
|
|
6625
6581
|
});
|
|
6626
6582
|
if (branchParseResult.success) {
|
|
6627
|
-
if (discriminatorResult.consumed.length > 0 || branchParseResult.consumed.length > 0) require_short_option.adoptOptionScope(context, branchParseResult.next);
|
|
6628
6583
|
const mergedExec = require_execution_context.mergeChildExec(discriminatorExec, branchParseResult.next.exec);
|
|
6629
6584
|
return {
|
|
6630
6585
|
success: true,
|
|
@@ -6648,29 +6603,26 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6648
6603
|
consumed: [...discriminatorResult.consumed, ...branchParseResult.consumed]
|
|
6649
6604
|
};
|
|
6650
6605
|
}
|
|
6651
|
-
if (discriminatorResult.consumed.length > 0) {
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
kind: "branch",
|
|
6662
|
-
key: value
|
|
6663
|
-
},
|
|
6664
|
-
branchState: require_annotation_state.getWrappedChildState(state, branchParser.initialState, branchParser)
|
|
6606
|
+
if (discriminatorResult.consumed.length > 0) return {
|
|
6607
|
+
success: true,
|
|
6608
|
+
next: {
|
|
6609
|
+
...discriminatorResult.next,
|
|
6610
|
+
state: {
|
|
6611
|
+
discriminatorState: annotatedDiscriminatorState,
|
|
6612
|
+
discriminatorValue: value,
|
|
6613
|
+
selectedBranch: {
|
|
6614
|
+
kind: "branch",
|
|
6615
|
+
key: value
|
|
6665
6616
|
},
|
|
6666
|
-
|
|
6667
|
-
exec: discriminatorExec,
|
|
6668
|
-
dependencyRegistry: discriminatorExec.dependencyRegistry
|
|
6669
|
-
} : {}
|
|
6617
|
+
branchState: require_annotation_state.getWrappedChildState(state, branchParser.initialState, branchParser)
|
|
6670
6618
|
},
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6619
|
+
...discriminatorExec != null ? {
|
|
6620
|
+
exec: discriminatorExec,
|
|
6621
|
+
dependencyRegistry: discriminatorExec.dependencyRegistry
|
|
6622
|
+
} : {}
|
|
6623
|
+
},
|
|
6624
|
+
consumed: discriminatorResult.consumed
|
|
6625
|
+
};
|
|
6674
6626
|
return branchParseResult;
|
|
6675
6627
|
}
|
|
6676
6628
|
}
|
|
@@ -6686,7 +6638,6 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
6686
6638
|
if (defaultResult.success && (defaultResult.consumed.length > 0 || discriminatorConsumed === 0 && context.buffer.length === 0)) {
|
|
6687
6639
|
const mergedExec = require_execution_context.mergeChildExec(context.exec, defaultResult.next.exec);
|
|
6688
6640
|
const commitDefault = defaultResult.consumed.length > 0 || context.buffer.length === 0;
|
|
6689
|
-
if (commitDefault) optionScope.select(context, defaultBranch);
|
|
6690
6641
|
return {
|
|
6691
6642
|
success: true,
|
|
6692
6643
|
...defaultResult.provisional ? { provisional: true } : {},
|
|
@@ -7345,9 +7296,7 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
7345
7296
|
} : void 0, "_discriminator"));
|
|
7346
7297
|
if (discComplete.success && syncBranches[discComplete.value] !== void 0) {
|
|
7347
7298
|
const resolvedBranch = syncBranches[discComplete.value];
|
|
7348
|
-
|
|
7349
|
-
optionScope.select(branchContext, resolvedBranch);
|
|
7350
|
-
yield* resolvedBranch.suggest(withChildContext$1(branchContext, "_branch", state.branchState ?? resolvedBranch.initialState, resolvedBranch), prefix);
|
|
7299
|
+
yield* resolvedBranch.suggest(withChildContext$1(suggestContext, "_branch", state.branchState ?? resolvedBranch.initialState, resolvedBranch), prefix);
|
|
7351
7300
|
} else if (syncDefaultBranch !== void 0) yield* syncDefaultBranch.suggest(withChildContext$1(suggestContext, "_branch", state.branchState ?? syncDefaultBranch.initialState, syncDefaultBranch), prefix);
|
|
7352
7301
|
} else {
|
|
7353
7302
|
const branchParser = state.selectedBranch.kind === "default" ? syncDefaultBranch : syncBranches[state.selectedBranch.key];
|
|
@@ -7401,9 +7350,7 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
7401
7350
|
} : void 0, "_discriminator"));
|
|
7402
7351
|
if (discComplete.success && branches[discComplete.value] !== void 0) {
|
|
7403
7352
|
const resolvedBranch = branches[discComplete.value];
|
|
7404
|
-
|
|
7405
|
-
optionScope.select(branchContext, resolvedBranch);
|
|
7406
|
-
yield* resolvedBranch.suggest(withChildContext$1(branchContext, "_branch", state.branchState ?? resolvedBranch.initialState, resolvedBranch), prefix);
|
|
7353
|
+
yield* resolvedBranch.suggest(withChildContext$1(suggestContext, "_branch", state.branchState ?? resolvedBranch.initialState, resolvedBranch), prefix);
|
|
7407
7354
|
discResolved = true;
|
|
7408
7355
|
}
|
|
7409
7356
|
}
|
|
@@ -7554,13 +7501,7 @@ function conditional(discriminator, branches, defaultBranch, options) {
|
|
|
7554
7501
|
configurable: true,
|
|
7555
7502
|
enumerable: false
|
|
7556
7503
|
});
|
|
7557
|
-
return require_modifiers.fluent(
|
|
7558
|
-
const selected = context.state?.selectedBranch;
|
|
7559
|
-
if (selected != null) {
|
|
7560
|
-
const branch = selected.kind === "default" ? defaultBranch : branches[selected.key];
|
|
7561
|
-
if (branch != null) optionScope.select(context, branch);
|
|
7562
|
-
}
|
|
7563
|
-
}));
|
|
7504
|
+
return require_modifiers.fluent(conditionalParser);
|
|
7564
7505
|
}
|
|
7565
7506
|
|
|
7566
7507
|
//#endregion
|