File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,9 @@ The Dune `browser` profile builds the playground compiler. Platform-dependent
4545modules are stored below ` platform/native/ ` and ` platform/playground/ ` in their
4646owning compiler directory. Rules in that directory's ` dune ` file copy the
4747selected implementation into the build directory as an ordinary ` .ml ` module;
48- all other profiles select the native source. Generated module paths in errors
49- or stack traces therefore map back to one of those two source directories.
48+ all other profiles select the native source. The rules use ` copy# ` , whose line
49+ directive makes locations (in errors, stack traces and ` .cmt ` files) name the
50+ platform source itself, so the two variants never share source positions.
5051
5152## Working on the Compiler
5253
Original file line number Diff line number Diff line change 55 (enabled_if
66 (= %{profile} browser))
77 (action
8- (copy platform/playground/js_name_of_module_id.ml js_name_of_module_id.ml)))
8+ (copy# platform/playground/js_name_of_module_id.ml js_name_of_module_id.ml)))
99
1010(rule
1111 (target js_name_of_module_id.ml)
1212 (enabled_if
1313 (<> %{profile} browser))
1414 (action
15- (copy platform/native/js_name_of_module_id.ml js_name_of_module_id.ml)))
15+ (copy# platform/native/js_name_of_module_id.ml js_name_of_module_id.ml)))
1616
1717(library
1818 (name core)
Original file line number Diff line number Diff line change 55 (enabled_if
66 (= %{profile} browser))
77 (action
8- (copy
8+ (copy#
99 platform/playground/ext_platform_primitives.ml
1010 ext_platform_primitives.ml)))
1111
1414 (enabled_if
1515 (<> %{profile} browser))
1616 (action
17- (copy
17+ (copy#
1818 platform/native/ext_platform_primitives.ml
1919 ext_platform_primitives.ml)))
2020
Original file line number Diff line number Diff line change @@ -156,7 +156,9 @@ let add_saved_type b =
156156let get_saved_types () = (current_accumulators () ).saved_types
157157let set_saved_types l = (current_accumulators () ).saved_types < - l
158158
159- let record_deprecated_used ?deprecated_context ?migration_template
159+ (* Live: called through a forward reference ({!Cmt_utils.record_deprecated_used}) with optional
160+ arguments that reanalyze cannot trace. *)
161+ let [@ live] record_deprecated_used ?deprecated_context ?migration_template
160162 ?migration_in_pipe_chain_template source_loc =
161163 let state = current_accumulators () in
162164 state.deprecated_used < -
Original file line number Diff line number Diff line change 55 (enabled_if
66 (= %{profile} browser))
77 (action
8- (copy
8+ (copy#
99 platform/playground/cmt_format_persistence.ml
1010 cmt_format_persistence.ml)))
1111
1414 (enabled_if
1515 (<> %{profile} browser))
1616 (action
17- (copy platform/native/cmt_format_persistence.ml cmt_format_persistence.ml)))
17+ (copy# platform/native/cmt_format_persistence.ml cmt_format_persistence.ml)))
1818
1919(library
2020 (name ml)
Original file line number Diff line number Diff line change @@ -237,7 +237,9 @@ let error_of_exn exn =
237237
238238(* taken from https://github.com/rescript-lang/ocaml/blob/d4144647d1bf9bc7dc3aadc24c25a7efa3a67915/parsing/location.ml#L380 *)
239239(* This is the error report entry point. We'll replace the default reporter with this one. *)
240- let rec default_error_reporter ?(custom_intro = None ) ?(src = None ) ppf
240+ (* Live: called through a forward reference ({!error_reporter}) with optional
241+ arguments that reanalyze cannot trace. *)
242+ let [@ live] rec default_error_reporter ?(custom_intro = None ) ?(src = None ) ppf
241243 {loc; msg; sub} =
242244 setup_colors () ;
243245 (* open a vertical box. Everything in our message is indented 2 spaces *)
Original file line number Diff line number Diff line change @@ -107,7 +107,9 @@ val default_error_reporter :
107107 formatter ->
108108 error ->
109109 unit
110- (* * Original error reporter for use in hooks. *)
110+ [@@ live]
111+ (* * Original error reporter for use in hooks. Live: called through
112+ {!error_reporter} with optional arguments that reanalyze cannot trace. *)
111113
112114val report_exception : formatter -> exn -> unit
113115(* * Reraise the exception if it is unknown. *)
Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ let extract_sig_open env loc mty =
8686
8787(* Compute the environment after opening a module *)
8888
89- let type_open_ ?used_slot ovf env loc lid =
89+ (* Live: called through a forward reference ({!Typecore.type_open}) with optional
90+ arguments that reanalyze cannot trace. *)
91+ let [@ live] type_open_ ?used_slot ovf env loc lid =
9092 let path = Typetexp. lookup_module ~load: true env lid.loc lid.txt in
9193 match Env. open_signature ~loc ?used_slot ovf path env with
9294 | Some env -> (path, env)
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ val type_open_ :
4141 Location .t ->
4242 Longident .t Asttypes .loc ->
4343 Path .t * Env .t
44+ [@@ live]
45+ (* Live: called through {!Typecore.type_open} with optional arguments that
46+ reanalyze cannot trace. *)
4447
4548val save_signature : string -> Typedtree .signature -> string -> string -> unit
4649
You can’t perform that action at this time.
0 commit comments