@@ -2056,6 +2056,7 @@ val symbol_gloc: unit -> t
20562056val rhs_loc: int -> t
20572057
20582058val input_name: string ref
2059+ val set_input_name: string -> unit
20592060val input_lexbuf: Lexing.lexbuf option ref
20602061
20612062val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
@@ -2217,7 +2218,8 @@ let rhs_loc n = {
22172218
22182219let input_name = ref "_none_"
22192220let input_lexbuf = ref (None : lexbuf option)
2220-
2221+ let set_input_name name =
2222+ if name <> "" then input_name := name
22212223(* Terminal info *)
22222224
22232225let status = ref Terminfo.Uninitialised
@@ -22420,7 +22422,7 @@ let apply_lazy ~source ~target mapper =
2242022422 if magic <> Config.ast_impl_magic_number
2242122423 && magic <> Config.ast_intf_magic_number then
2242222424 failwith "Ast_mapper: OCaml version mismatch or malformed input";
22423- Location.input_name := input_value ic;
22425+ Location.set_input_name @@ input_value ic;
2242422426 let ast = input_value ic in
2242522427 close_in ic;
2242622428
@@ -22831,7 +22833,7 @@ let read_ast magic fn =
2283122833 try
2283222834 let buffer = really_input_string ic (String.length magic) in
2283322835 assert(buffer = magic); (* already checked by apply_rewriter *)
22834- Location.input_name := input_value ic;
22836+ Location.set_input_name @@ input_value ic;
2283522837 let ast = input_value ic in
2283622838 close_in ic;
2283722839 Misc.remove_file fn;
@@ -22899,11 +22901,11 @@ let file ppf ~tool_name inputfile parse_fun ast_magic =
2289922901 (* FIXME make this a proper warning *)
2290022902 fprintf ppf "@[Warning: %s@]@."
2290122903 "option -unsafe used with a preprocessor returning a syntax tree";
22902- Location.input_name := input_value ic;
22904+ Location.set_input_name @@ input_value ic;
2290322905 input_value ic
2290422906 end else begin
2290522907 seek_in ic 0;
22906- Location.input_name := inputfile;
22908+ Location.set_input_name inputfile;
2290722909 let lexbuf = Lexing.from_channel ic in
2290822910 Location.init lexbuf inputfile;
2290922911 parse_fun lexbuf
@@ -22930,7 +22932,7 @@ let () =
2293022932 )
2293122933
2293222934let parse_all ~tool_name parse_fun magic ppf sourcefile =
22933- Location.input_name := sourcefile;
22935+ Location.set_input_name sourcefile;
2293422936 let inputfile = preprocess sourcefile in
2293522937 let ast =
2293622938 try file ppf ~tool_name inputfile parse_fun magic
@@ -29740,6 +29742,8 @@ val force_cmj : bool ref
2974029742val jsx_version : int ref
2974129743val refmt : string option ref
2974229744val is_reason : bool ref
29745+
29746+ val no_js_stdout : bool ref
2974329747end = struct
2974429748#1 "js_config.ml"
2974529749(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -29852,6 +29856,8 @@ let jsx_version = ref (-1)
2985229856let refmt = ref None
2985329857
2985429858let is_reason = ref false
29859+
29860+ let no_js_stdout = ref false
2985529861end
2985629862module Bs_warnings : sig
2985729863#1 "bs_warnings.mli"
0 commit comments