Permalink
Browse files

Reverse result list at the end of ignore_toplevel

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 4, 2018
1 parent 71cf8e5 commit 864c84c890ff58a6a396d33a1ce999e07ada7aac
Showing with 2 additions and 2 deletions.
  1. +2 −2 hphp/hack/src/parser/parser_hack.ml
@@ -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 *)
@@ -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

0 comments on commit 864c84c

Please sign in to comment.