makeLogicalRight() {
		const currentChoiceContext = this.choiceContext;
		const forkContext = this.forkContext;

		if (currentChoiceContext.processed) {
			/*
			 * This context was already assigned segments from a child
			 * choice context. In this case, we are concerned only about
			 * the path that does not short-circuit and so ends up on the
			 * right-hand operand of the logical expression.
			 */
			let prevForkContext;

			switch (currentChoiceContext.kind) {
				case "&&": // if true then go to the right-hand side.
					prevForkContext = currentChoiceContext.trueForkContext;
					break;
				case "||": // if false then go to the right-hand side.
					prevForkContext = currentChoiceContext.falseForkContext;
					break;
				case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's nullishForkContext.
					prevForkContext = currentChoiceContext.nullishForkContext;
					break;
				default:
					throw new Error("unreachable");
			}

			/*
			 * Create the segment for the right-hand operand of the logical expression
			 * and adjust the fork context pointer to point there. The right-hand segment
			 * is added at the end of all segments in `prevForkContext`.
			 */
			forkContext.replaceHead(prevForkContext.makeNext(0, -1));

			/*
			 * We no longer need this list of segments.
			 *
			 * Reset `processed` because we've removed the segments from the child
			 * choice context. This allows `popChoiceContext()` to continue adding
			 * segments later.
			 */
			prevForkContext.clear();
			currentChoiceContext.processed = false;
		} else {
			/*
			 * This choice context was not assigned segments from a child
			 * choice context, which means that it's a terminal logical
			 * expression.
			 *
			 * `head` is the segments for the left-hand operand of the
			 * logical expression.
			 *
			 * Each of the fork contexts below are empty at this point. We choose
			 * the path(s) that will short-circuit and add the segment for the
			 * left-hand operand to it. Ultimately, this will be the only segment
			 * in that path due to the short-circuting, so we are just seeding
			 * these paths to start.
			 */
			switch (currentChoiceContext.kind) {
				case "&&":
					/*
					 * In most contexts, when a && expression evaluates to false,
					 * it short circuits, so we need to account for that by setting
					 * the `falseForkContext` to the left operand.
					 *
					 * When a && expression is the left-hand operand for a ??
					 * expression, such as `(a && b) ?? c`, a nullish value will
					 * also short-circuit in a different way than a false value,
					 * so we also set the `nullishForkContext` to the left operand.
					 * This path is only used with a ?? expression and is thrown
					 * away for any other type of logical expression, so it's safe
					 * to always add.
					 */
					currentChoiceContext.falseForkContext.add(forkContext.head);
					currentChoiceContext.nullishForkContext.add(
						forkContext.head,
					);
					break;
				case "||": // the true path can short-circuit.
					currentChoiceContext.trueForkContext.add(forkContext.head);
					break;
				case "??": // both can short-circuit.
					currentChoiceContext.trueForkContext.add(forkContext.head);
					currentChoiceContext.falseForkContext.add(forkContext.head);
					break;
				default:
					throw new Error("unreachable");
			}

			/*
			 * Create the segment for the right-hand operand of the logical expression
			 * and adjust the fork context pointer to point there.
			 */
			forkContext.replaceHead(forkContext.makeNext(-1, -1));
		}
	}
Creates a code path segment to represent right-hand operand of a logical
expression.
This is called in the preprocessing phase when entering a node.
@throws {Error} (Unreachable.)
@returns {void}