Skip to content

Commit

Permalink
Reverse result list at the end of ignore_toplevel
Browse files Browse the repository at this point in the history
Summary: `ignore_toplevel` is structured similar to `toplevel` however it does not reverse result list and thus returns results in wrong order. This messes up other things downstream in FFP integration work.

Differential Revision: D6656918
  • Loading branch information
vladima authored and fredemmott committed Jan 29, 2018
1 parent 71cf8e5 commit 864c84c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hphp/hack/src/parser/parser_hack.ml
Expand Up @@ -549,7 +549,7 @@ and ignore_toplevel attr_start ~attr acc env terminate =
match L.token env.file env.lb with
| x when terminate x || x = Teof ->
L.back env.lb;
acc
List.rev acc
| Tltlt ->
(* Parsing attribute << .. >> *)
(* TODO: error for repeated attribute list *)
Expand Down Expand Up @@ -621,7 +621,7 @@ and ignore_toplevel attr_start ~attr acc env terminate =
)
| Tclose_php ->
error env "Hack does not allow the closing ?> tag";
acc
List.rev acc
| _ ->
(* All the other statements. *)
ignore_toplevel None ~attr:[] acc env terminate
Expand Down

0 comments on commit 864c84c

Please sign in to comment.