summaryrefslogtreecommitdiff
path: root/src/reporting_basic.ml
diff options
context:
space:
mode:
authorBrian Campbell2017-10-18 15:07:24 +0100
committerBrian Campbell2017-10-18 15:07:24 +0100
commitbd9cabab3e20b92a705f37f0a1974033a869bde0 (patch)
treec73e3e47b4ce0578c9b79ca3ebd3ad74db93ffa4 /src/reporting_basic.ml
parent79043c19238559a7daea7b495e604ef00a6b2a8c (diff)
parent4043f496ff8dae7fa2bc2b4da4e02d2d9942e66d (diff)
Merge branch 'experiments' of Peter_Sewell/sail into mono-experiments
(and fix up monomorphisation)
Diffstat (limited to 'src/reporting_basic.ml')
-rw-r--r--src/reporting_basic.ml18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/reporting_basic.ml b/src/reporting_basic.ml
index e552dca4..a47ee8ae 100644
--- a/src/reporting_basic.ml
+++ b/src/reporting_basic.ml
@@ -87,14 +87,6 @@
(* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *)
(**************************************************************************)
-let format_pos ff p =
- let open Lexing in
- begin
- Format.fprintf ff "file \"%s\", line %d, character %d:\n"
- p.pos_fname p.pos_lnum (p.pos_cnum - p.pos_bol);
- Format.pp_print_flush ff ()
- end
-
let rec skip_lines in_chan = function
| n when n <= 0 -> ()
| n -> input_line in_chan; skip_lines in_chan (n - 1)
@@ -126,6 +118,16 @@ let print_code1 ff fname lnum1 cnum1 cnum2 =
end
with _ -> ()
+let format_pos ff p =
+ let open Lexing in
+ begin
+ Format.fprintf ff "file \"%s\", line %d, character %d:\n\n"
+ p.pos_fname p.pos_lnum (p.pos_cnum - p.pos_bol);
+ print_code1 ff p.pos_fname p.pos_lnum (p.pos_cnum - p.pos_bol) (p.pos_cnum - p.pos_bol + 1);
+ Format.fprintf ff "\n\n";
+ Format.pp_print_flush ff ()
+ end
+
let print_code2 ff fname lnum1 cnum1 lnum2 cnum2 =
try
let in_chan = open_in fname in