Skip to content

Commit 0501045

Browse files
committed
sync ocaml
1 parent 7dd10d7 commit 0501045

File tree

8 files changed

+34
-20
lines changed

8 files changed

+34
-20
lines changed

lib/4.02.3/bsdep.ml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,7 @@ val symbol_gloc: unit -> t
20562056
val rhs_loc: int -> t
20572057

20582058
val input_name: string ref
2059+
val set_input_name: string -> unit
20592060
val input_lexbuf: Lexing.lexbuf option ref
20602061

20612062
val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
@@ -2217,7 +2218,8 @@ let rhs_loc n = {
22172218

22182219
let input_name = ref "_none_"
22192220
let input_lexbuf = ref (None : lexbuf option)
2220-
2221+
let set_input_name name =
2222+
if name <> "" then input_name := name
22212223
(* Terminal info *)
22222224

22232225
let 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

2293222934
let 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

lib/4.02.3/bspp.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ val symbol_gloc: unit -> t
19931993
val rhs_loc: int -> t
19941994

19951995
val input_name: string ref
1996+
val set_input_name: string -> unit
19961997
val input_lexbuf: Lexing.lexbuf option ref
19971998

19981999
val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
@@ -2154,7 +2155,8 @@ let rhs_loc n = {
21542155

21552156
let input_name = ref "_none_"
21562157
let input_lexbuf = ref (None : lexbuf option)
2157-
2158+
let set_input_name name =
2159+
if name <> "" then input_name := name
21582160
(* Terminal info *)
21592161

21602162
let status = ref Terminfo.Uninitialised

lib/4.02.3/bsppx.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ val symbol_gloc: unit -> t
19931993
val rhs_loc: int -> t
19941994

19951995
val input_name: string ref
1996+
val set_input_name: string -> unit
19961997
val input_lexbuf: Lexing.lexbuf option ref
19971998

19981999
val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
@@ -2154,7 +2155,8 @@ let rhs_loc n = {
21542155

21552156
let input_name = ref "_none_"
21562157
let input_lexbuf = ref (None : lexbuf option)
2157-
2158+
let set_input_name name =
2159+
if name <> "" then input_name := name
21582160
(* Terminal info *)
21592161

21602162
let status = ref Terminfo.Uninitialised
@@ -23806,7 +23808,7 @@ let apply_lazy ~source ~target mapper =
2380623808
if magic <> Config.ast_impl_magic_number
2380723809
&& magic <> Config.ast_intf_magic_number then
2380823810
failwith "Ast_mapper: OCaml version mismatch or malformed input";
23809-
Location.input_name := input_value ic;
23811+
Location.set_input_name @@ input_value ic;
2381023812
let ast = input_value ic in
2381123813
close_in ic;
2381223814

lib/4.02.3/unstable/bspack.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ val symbol_gloc: unit -> t
19931993
val rhs_loc: int -> t
19941994

19951995
val input_name: string ref
1996+
val set_input_name: string -> unit
19961997
val input_lexbuf: Lexing.lexbuf option ref
19971998

19981999
val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
@@ -2154,7 +2155,8 @@ let rhs_loc n = {
21542155

21552156
let input_name = ref "_none_"
21562157
let input_lexbuf = ref (None : lexbuf option)
2157-
2158+
let set_input_name name =
2159+
if name <> "" then input_name := name
21582160
(* Terminal info *)
21592161

21602162
let status = ref Terminfo.Uninitialised

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ val symbol_gloc: unit -> t
19931993
val rhs_loc: int -> t
19941994

19951995
val input_name: string ref
1996+
val set_input_name: string -> unit
19961997
val input_lexbuf: Lexing.lexbuf option ref
19971998

19981999
val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
@@ -2154,7 +2155,8 @@ let rhs_loc n = {
21542155

21552156
let input_name = ref "_none_"
21562157
let input_lexbuf = ref (None : lexbuf option)
2157-
2158+
let set_input_name name =
2159+
if name <> "" then input_name := name
21582160
(* Terminal info *)
21592161

21602162
let status = ref Terminfo.Uninitialised
@@ -44871,7 +44873,7 @@ let apply_lazy ~source ~target mapper =
4487144873
if magic <> Config.ast_impl_magic_number
4487244874
&& magic <> Config.ast_intf_magic_number then
4487344875
failwith "Ast_mapper: OCaml version mismatch or malformed input";
44874-
Location.input_name := input_value ic;
44876+
Location.set_input_name @@ input_value ic;
4487544877
let ast = input_value ic in
4487644878
close_in ic;
4487744879

lib/4.02.3/unstable/native_ppx.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ val symbol_gloc: unit -> t
19931993
val rhs_loc: int -> t
19941994

19951995
val input_name: string ref
1996+
val set_input_name: string -> unit
19961997
val input_lexbuf: Lexing.lexbuf option ref
19971998

19981999
val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
@@ -2154,7 +2155,8 @@ let rhs_loc n = {
21542155

21552156
let input_name = ref "_none_"
21562157
let input_lexbuf = ref (None : lexbuf option)
2157-
2158+
let set_input_name name =
2159+
if name <> "" then input_name := name
21582160
(* Terminal info *)
21592161

21602162
let status = ref Terminfo.Uninitialised

lib/4.02.3/whole_compiler.ml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4343,6 +4343,7 @@ val symbol_gloc: unit -> t
43434343
val rhs_loc: int -> t
43444344

43454345
val input_name: string ref
4346+
val set_input_name: string -> unit
43464347
val input_lexbuf: Lexing.lexbuf option ref
43474348

43484349
val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
@@ -4504,7 +4505,8 @@ let rhs_loc n = {
45044505

45054506
let input_name = ref "_none_"
45064507
let input_lexbuf = ref (None : lexbuf option)
4507-
4508+
let set_input_name name =
4509+
if name <> "" then input_name := name
45084510
(* Terminal info *)
45094511

45104512
let status = ref Terminfo.Uninitialised
@@ -33092,7 +33094,7 @@ let apply_lazy ~source ~target mapper =
3309233094
if magic <> Config.ast_impl_magic_number
3309333095
&& magic <> Config.ast_intf_magic_number then
3309433096
failwith "Ast_mapper: OCaml version mismatch or malformed input";
33095-
Location.input_name := input_value ic;
33097+
Location.set_input_name @@ input_value ic;
3309633098
let ast = input_value ic in
3309733099
close_in ic;
3309833100

@@ -114731,7 +114733,7 @@ let read_ast magic fn =
114731114733
try
114732114734
let buffer = really_input_string ic (String.length magic) in
114733114735
assert(buffer = magic); (* already checked by apply_rewriter *)
114734-
Location.input_name := input_value ic;
114736+
Location.set_input_name @@ input_value ic;
114735114737
let ast = input_value ic in
114736114738
close_in ic;
114737114739
Misc.remove_file fn;
@@ -114799,11 +114801,11 @@ let file ppf ~tool_name inputfile parse_fun ast_magic =
114799114801
(* FIXME make this a proper warning *)
114800114802
fprintf ppf "@[Warning: %s@]@."
114801114803
"option -unsafe used with a preprocessor returning a syntax tree";
114802-
Location.input_name := input_value ic;
114804+
Location.set_input_name @@ input_value ic;
114803114805
input_value ic
114804114806
end else begin
114805114807
seek_in ic 0;
114806-
Location.input_name := inputfile;
114808+
Location.set_input_name inputfile;
114807114809
let lexbuf = Lexing.from_channel ic in
114808114810
Location.init lexbuf inputfile;
114809114811
parse_fun lexbuf
@@ -114830,7 +114832,7 @@ let () =
114830114832
)
114831114833

114832114834
let parse_all ~tool_name parse_fun magic ppf sourcefile =
114833-
Location.input_name := sourcefile;
114835+
Location.set_input_name sourcefile;
114834114836
let inputfile = preprocess sourcefile in
114835114837
let ast =
114836114838
try file ppf ~tool_name inputfile parse_fun magic

ocaml

Submodule ocaml updated from 8acf17a to 182dbd3

0 commit comments

Comments
 (0)