| 525 | } |
| 526 | |
| 527 | const sequenceInnerToTuple = (inner: Sequence.Inner): SequenceTuple => { |
| 528 | const tuple: mutable<SequenceTuple> = [] |
| 529 | if (inner.prefix) |
| 530 | for (const node of inner.prefix) tuple.push({ kind: "prefix", node }) |
| 531 | if (inner.defaultables) { |
| 532 | for (const [node, defaultValue] of inner.defaultables) |
| 533 | tuple.push({ kind: "defaultables", node, default: defaultValue }) |
| 534 | } |
| 535 | |
| 536 | if (inner.optionals) |
| 537 | for (const node of inner.optionals) tuple.push({ kind: "optionals", node }) |
| 538 | if (inner.variadic) tuple.push({ kind: "variadic", node: inner.variadic }) |
| 539 | if (inner.postfix) |
| 540 | for (const node of inner.postfix) tuple.push({ kind: "postfix", node }) |
| 541 | return tuple |
| 542 | } |
| 543 | |
| 544 | export const postfixAfterOptionalOrDefaultableMessage = |
| 545 | "A postfix required element cannot follow an optional or defaultable element" |