From 2e2c07a681a7bce66e3164b428ce333cd7d56420 Mon Sep 17 00:00:00 2001 From: Mike Qian Date: Fri, 19 Dec 2014 13:25:47 -0800 Subject: [PATCH] Don't destroy whitespace in files with "**/" in comments Summary: ** is lexed as exponentiation operator, which then results in unterminated comment, and everything breaks. Reviewed By: @elgenie Differential Revision: D1741716 --- hphp/hack/src/parsing/format_hack.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hphp/hack/src/parsing/format_hack.ml b/hphp/hack/src/parsing/format_hack.ml index f9ff9bcc312..21ba3869102 100644 --- a/hphp/hack/src/parsing/format_hack.ml +++ b/hphp/hack/src/parsing/format_hack.ml @@ -681,6 +681,11 @@ and comment_loop env = | Teof -> () | Tclose_comment -> last_token env; + | Tstarstar -> + last_token env; + (match token env with + | Tslash -> last_token env + | _ -> comment_loop env) | Tnewline -> newline env; skip_spaces env; -- 2.11.4.GIT