Skip to content

Commit f193a8f

Browse files
committed
snapshot changes
1 parent f2ae500 commit f193a8f

File tree

3 files changed

+30
-54
lines changed

3 files changed

+30
-54
lines changed

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -411780,21 +411780,13 @@ end
411780411780
module Super_location
411781411781
= struct
411782411782
#1 "super_location.ml"
411783-
(* open Misc
411784-
open Asttypes
411785-
open Parsetree
411786-
open Types
411787-
open Typedtree
411788-
open Btype
411789-
open Ctype *)
411790411783

411791-
open Format
411792-
(* open Printtyp *)
411793411784

411794-
open Location
411785+
let fprintf = Format.fprintf
411786+
411787+
411795411788

411796411789
let file_lines filePath =
411797-
(* open_in_bin works on windows, as opposed to open_in, afaik? *)
411798411790
let chan = open_in_bin filePath in
411799411791
let lines = ref [] in
411800411792
try
@@ -411819,11 +411811,11 @@ let print_filename ppf file =
411819411811
| "" -> Format.fprintf ppf "(No file name)"
411820411812
| real_file -> Format.fprintf ppf "%s" (Location.show_filename real_file)
411821411813

411822-
let print_loc ~normalizedRange ppf loc =
411814+
let print_loc ~normalizedRange ppf (loc : Location.t) =
411823411815
setup_colors ();
411824411816
let (file, _, _) = Location.get_pos_info loc.loc_start in
411825411817
if file = "//toplevel//" then begin
411826-
if highlight_locations ppf [loc] then () else
411818+
if Location.highlight_locations ppf [loc] then () else
411827411819
fprintf ppf "Characters %i-%i"
411828411820
loc.loc_start.pos_cnum loc.loc_end.pos_cnum
411829411821
end else
@@ -411841,9 +411833,9 @@ let print_loc ~normalizedRange ppf loc =
411841411833
fprintf ppf "@{<filename>%a@}%a" print_filename file dim_loc normalizedRange
411842411834
;;
411843411835

411844-
let print ~message_kind intro ppf loc =
411836+
let print ~message_kind intro ppf (loc : Location.t) =
411845411837
if loc.loc_start.pos_fname = "//toplevel//"
411846-
&& highlight_locations ppf [loc] then ()
411838+
&& Location.highlight_locations ppf [loc] then ()
411847411839
else
411848411840
begin match message_kind with
411849411841
| `warning -> fprintf ppf "@[@{<info>%s@}@]@," intro
@@ -411937,17 +411929,17 @@ let print_phanton_error_prefix ppf =
411937411929
(see super_error_reporter above) *)
411938411930
Format.pp_print_as ppf 2 ""
411939411931

411940-
let errorf ?(loc = none) ?(sub = []) ?(if_highlight = "") fmt =
411932+
let errorf ?(loc = Location.none) ?(sub = []) ?(if_highlight = "") fmt =
411941411933
Location.pp_ksprintf
411942411934
~before:print_phanton_error_prefix
411943-
(fun msg -> {loc; msg; sub; if_highlight})
411935+
(fun msg -> Location.{loc; msg; sub; if_highlight})
411944411936
fmt
411945411937

411946411938
let error_of_printer loc print x =
411947411939
errorf ~loc "%a@?" print x
411948411940

411949411941
let error_of_printer_file print x =
411950-
error_of_printer (in_file !input_name) print x
411942+
error_of_printer (Location.in_file !Location.input_name) print x
411951411943

411952411944
(* This will be called in super_main. This is how you override the default error and warning printers *)
411953411945
let setup () =

lib/4.06.1/unstable/js_refmt_compiler.ml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -571876,21 +571876,13 @@ end
571876571876
module Super_location
571877571877
= struct
571878571878
#1 "super_location.ml"
571879-
(* open Misc
571880-
open Asttypes
571881-
open Parsetree
571882-
open Types
571883-
open Typedtree
571884-
open Btype
571885-
open Ctype *)
571886571879

571887-
open Format
571888-
(* open Printtyp *)
571889571880

571890-
open Location
571881+
let fprintf = Format.fprintf
571882+
571883+
571891571884

571892571885
let file_lines filePath =
571893-
(* open_in_bin works on windows, as opposed to open_in, afaik? *)
571894571886
let chan = open_in_bin filePath in
571895571887
let lines = ref [] in
571896571888
try
@@ -571915,11 +571907,11 @@ let print_filename ppf file =
571915571907
| "" -> Format.fprintf ppf "(No file name)"
571916571908
| real_file -> Format.fprintf ppf "%s" (Location.show_filename real_file)
571917571909

571918-
let print_loc ~normalizedRange ppf loc =
571910+
let print_loc ~normalizedRange ppf (loc : Location.t) =
571919571911
setup_colors ();
571920571912
let (file, _, _) = Location.get_pos_info loc.loc_start in
571921571913
if file = "//toplevel//" then begin
571922-
if highlight_locations ppf [loc] then () else
571914+
if Location.highlight_locations ppf [loc] then () else
571923571915
fprintf ppf "Characters %i-%i"
571924571916
loc.loc_start.pos_cnum loc.loc_end.pos_cnum
571925571917
end else
@@ -571937,9 +571929,9 @@ let print_loc ~normalizedRange ppf loc =
571937571929
fprintf ppf "@{<filename>%a@}%a" print_filename file dim_loc normalizedRange
571938571930
;;
571939571931

571940-
let print ~message_kind intro ppf loc =
571932+
let print ~message_kind intro ppf (loc : Location.t) =
571941571933
if loc.loc_start.pos_fname = "//toplevel//"
571942-
&& highlight_locations ppf [loc] then ()
571934+
&& Location.highlight_locations ppf [loc] then ()
571943571935
else
571944571936
begin match message_kind with
571945571937
| `warning -> fprintf ppf "@[@{<info>%s@}@]@," intro
@@ -572033,17 +572025,17 @@ let print_phanton_error_prefix ppf =
572033572025
(see super_error_reporter above) *)
572034572026
Format.pp_print_as ppf 2 ""
572035572027

572036-
let errorf ?(loc = none) ?(sub = []) ?(if_highlight = "") fmt =
572028+
let errorf ?(loc = Location.none) ?(sub = []) ?(if_highlight = "") fmt =
572037572029
Location.pp_ksprintf
572038572030
~before:print_phanton_error_prefix
572039-
(fun msg -> {loc; msg; sub; if_highlight})
572031+
(fun msg -> Location.{loc; msg; sub; if_highlight})
572040572032
fmt
572041572033

572042572034
let error_of_printer loc print x =
572043572035
errorf ~loc "%a@?" print x
572044572036

572045572037
let error_of_printer_file print x =
572046-
error_of_printer (in_file !input_name) print x
572038+
error_of_printer (Location.in_file !Location.input_name) print x
572047572039

572048572040
(* This will be called in super_main. This is how you override the default error and warning printers *)
572049572041
let setup () =

lib/4.06.1/whole_compiler.ml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -436869,21 +436869,13 @@ end
436869436869
module Super_location
436870436870
= struct
436871436871
#1 "super_location.ml"
436872-
(* open Misc
436873-
open Asttypes
436874-
open Parsetree
436875-
open Types
436876-
open Typedtree
436877-
open Btype
436878-
open Ctype *)
436879436872

436880-
open Format
436881-
(* open Printtyp *)
436882436873

436883-
open Location
436874+
let fprintf = Format.fprintf
436875+
436876+
436884436877

436885436878
let file_lines filePath =
436886-
(* open_in_bin works on windows, as opposed to open_in, afaik? *)
436887436879
let chan = open_in_bin filePath in
436888436880
let lines = ref [] in
436889436881
try
@@ -436908,11 +436900,11 @@ let print_filename ppf file =
436908436900
| "" -> Format.fprintf ppf "(No file name)"
436909436901
| real_file -> Format.fprintf ppf "%s" (Location.show_filename real_file)
436910436902

436911-
let print_loc ~normalizedRange ppf loc =
436903+
let print_loc ~normalizedRange ppf (loc : Location.t) =
436912436904
setup_colors ();
436913436905
let (file, _, _) = Location.get_pos_info loc.loc_start in
436914436906
if file = "//toplevel//" then begin
436915-
if highlight_locations ppf [loc] then () else
436907+
if Location.highlight_locations ppf [loc] then () else
436916436908
fprintf ppf "Characters %i-%i"
436917436909
loc.loc_start.pos_cnum loc.loc_end.pos_cnum
436918436910
end else
@@ -436930,9 +436922,9 @@ let print_loc ~normalizedRange ppf loc =
436930436922
fprintf ppf "@{<filename>%a@}%a" print_filename file dim_loc normalizedRange
436931436923
;;
436932436924

436933-
let print ~message_kind intro ppf loc =
436925+
let print ~message_kind intro ppf (loc : Location.t) =
436934436926
if loc.loc_start.pos_fname = "//toplevel//"
436935-
&& highlight_locations ppf [loc] then ()
436927+
&& Location.highlight_locations ppf [loc] then ()
436936436928
else
436937436929
begin match message_kind with
436938436930
| `warning -> fprintf ppf "@[@{<info>%s@}@]@," intro
@@ -437026,17 +437018,17 @@ let print_phanton_error_prefix ppf =
437026437018
(see super_error_reporter above) *)
437027437019
Format.pp_print_as ppf 2 ""
437028437020

437029-
let errorf ?(loc = none) ?(sub = []) ?(if_highlight = "") fmt =
437021+
let errorf ?(loc = Location.none) ?(sub = []) ?(if_highlight = "") fmt =
437030437022
Location.pp_ksprintf
437031437023
~before:print_phanton_error_prefix
437032-
(fun msg -> {loc; msg; sub; if_highlight})
437024+
(fun msg -> Location.{loc; msg; sub; if_highlight})
437033437025
fmt
437034437026

437035437027
let error_of_printer loc print x =
437036437028
errorf ~loc "%a@?" print x
437037437029

437038437030
let error_of_printer_file print x =
437039-
error_of_printer (in_file !input_name) print x
437031+
error_of_printer (Location.in_file !Location.input_name) print x
437040437032

437041437033
(* This will be called in super_main. This is how you override the default error and warning printers *)
437042437034
let setup () =

0 commit comments

Comments
 (0)