Enforce Pos_or_decl.t in reasons for decl types
[hiphop-php.git] / hphp / hack / src / typing / typing_ast_print.ml
blob665bf1b97f75d163e97d12edc2289ead18254a46
1 (*
2 * Copyright (c) Facebook, Inc. and its affiliates.
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the "hack" directory of this source tree.
7 *)
9 let print_tast ctx tast =
10 let dummy_filename = Relative_path.default in
11 let env = Typing_env.empty ctx dummy_filename ~droot:None in
12 let print_pos_and_ty (pos, ty) =
13 Format.asprintf "(%a, %s)" Pos.pp pos (Typing_print.full_strip_ns env ty)
15 let pp_fb fmt _ = Format.pp_print_string fmt "()" in
16 let pp_en fmt _ = Format.pp_print_string fmt "()" in
17 let pp_ex fmt ex = Format.pp_print_string fmt (print_pos_and_ty ex) in
18 let pp_hi fmt ty =
19 Format.asprintf "(%s)" (Typing_print.full_strip_ns env ty)
20 |> Format.pp_print_string fmt
22 let formatter = Format.formatter_of_out_channel Stdlib.stdout in
23 Format.pp_set_margin formatter 200;
24 Aast.pp_program pp_ex pp_fb pp_en pp_hi formatter tast