From e157e99f3a7a7868f263ca95925e24d2e9566c01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philip=20H=C3=B6lzenspies?= Date: Thu, 2 Mar 2017 01:48:13 -0800 Subject: [PATCH] Cut-over of `hh_emitter` to use the Full Fidelity Parser Summary: Does what it says on the tin. Adding hubyrod as a reviewer, because he knows more about the time-line towards killing `hh_emitter`. If this diff doesn't get in the way of anything and looks good, I would still like to push this through to clean up the legacy-calls. Reviewed By: hubyrod Differential Revision: D4620273 fbshipit-source-id: 80d2cb98e0f73339f5c8cfc8c3834b123d65d82a --- hphp/hack/src/hh_emitter.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hphp/hack/src/hh_emitter.ml b/hphp/hack/src/hh_emitter.ml index c2bbf189edf..3b58123322b 100644 --- a/hphp/hack/src/hh_emitter.ml +++ b/hphp/hack/src/hh_emitter.ml @@ -58,14 +58,16 @@ let parse_options () = (* Main body *) (*****************************************************************************) let emit_file { filename; read_stdin; is_test } () = + let module Text = Full_fidelity_source_text in let filename = Relative_path.create Relative_path.Dummy filename in let contents = - if read_stdin then Sys_utils.read_stdin_to_string () else - Sys_utils.cat (Relative_path.to_absolute filename) in + if read_stdin + then Text.make (Sys_utils.read_stdin_to_string ()) + else Text.from_file filename + in (* Parse the file and pull out the parts we need *) - let parsed_file = - Parser_hack.program_with_default_popt filename contents in + let parsed_file = Full_fidelity_ast.from_text_with_legacy filename contents in let {Parser_hack.file_mode; comments; ast; _} = parsed_file in let funs, classes, typedefs, consts = Ast_utils.get_defs ast in -- 2.11.4.GIT