Rewrite elseif clauses for coroutine generator
commit719840677515b4c51901ea2efee98f027d369d77
authorEric Lippert <ericlippert@fb.com>
Thu, 11 May 2017 23:01:20 +0000 (11 16:01 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 11 May 2017 23:02:48 +0000 (11 16:02 -0700)
treecec8f5feb05421b8c3d0894cf0ee2f25a3c7e995
parentd1ed70cb9e9b4f94ae9ad33ab2e10742332725a2
Rewrite elseif clauses for coroutine generator

Summary:
We need to rewrite

    if (suspend x()) a;
    elseif (suspend y()) b;
    else c;

as

    $tx = suspend x();
    if ($tx) a;
    else {
      $ty = suspend y();
      if ($ty) b;
      else c;
    }

so that the suspend rewriter can do its work correctly.

Reviewed By: michaeltingley

Differential Revision: D5029230

fbshipit-source-id: 49d94742f95747475ec7aec91b55b23d2dd0fc20
hphp/hack/src/parser/coroutine/coroutine_state_machine_generator.ml
hphp/hack/src/parser/coroutine/coroutine_syntax.ml
hphp/hack/src/parser/full_fidelity_editable_token.ml