-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdmlloc.ml
More file actions
33 lines (26 loc) · 1.33 KB
/
dmlloc.ml
File metadata and controls
33 lines (26 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(*******************************************************************)
(* *)
(* Dependent ML *)
(* *)
(* (c) Hongwei Xi *)
(* July 2000 *)
(* *)
(* University of Cincinnati *)
(* *)
(* Distributed by permission only. *)
(* *)
(*******************************************************************)
(* dmlloc - Handling the locations of symbols. *)
type location = { loc_s: int; loc_e: int }
let none_loc = { loc_s = -1; loc_e = -1 }
let symbol_loc () = {
loc_s = Parsing.symbol_start();
loc_e = Parsing.symbol_end()
}
let loc_pr loc =
"Location: Char: " ^ (string_of_int loc.loc_s) ^ "-" ^ (string_of_int loc.loc_e)
let print_loc loc =
let _ = print_string "Characters " in
let _ = print_int loc.loc_s; print_string "-" in
let _ = print_int loc.loc_e; print_string ":"
in Format.force_newline()