Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/snippet.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(** Representation of OCaml code snippets. *)

open Names

(** {1 Snippets} *)

type t =
Expand Down Expand Up @@ -93,8 +95,12 @@ module Scaffold = struct
let file =
match loc.fname with
| ToplevelInput ->
(* FIXME: Obtain original file name under ProofGeneral's toplevel. *)
"_toplevel_"
(* Use the module name set by the [-top] option, if any. *)
let _, top_module_name = Libnames.split_dirpath (Lib.library_dp ()) in
begin match Id.to_string top_module_name with
| "Top" (* default *) -> "_toplevel_"
| name -> name ^ ".v"
end
| InFile { file; _ } -> file
in
add_line_number_directive ~line:loc.line_nb ~file scaffold;
Expand Down
Loading