function nested_state_machine()

in aws/hhvm1/state-machine/generate.hack [349:369]


function nested_state_machine(
  string $end_state_prefix,
  ?P $add_param_to_results,
  dict<string, State> $states,
): StateMachine {
  return linear_state_machine(
    $end_state_prefix.S::End,
    Dict\merge(
      $states,
      dict[
        $end_state_prefix.S::End => dict[
          F::Type => T::Pass,
          F::Parameters => $add_param_to_results is nonnull
            ? params($add_param_to_results, P::Results)
            : params(P::Results),
          F::End => true,
        ],
      ],
    ),
  );
}