-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.ml
More file actions
45 lines (27 loc) · 699 Bytes
/
Copy patherror.ml
File metadata and controls
45 lines (27 loc) · 699 Bytes
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
33
34
35
36
37
38
39
40
41
42
type info = Inf of string * int * int | Noinf
exception Dummy
type 'a withinfo = {i: info; v: 'a}
let dummyinfo = Noinf
let create_info f l c = Inf (f, l, c)
let print_info =
function
Inf (f,l,c) ->
print_string f; print_string ":"; print_int l; print_string ".";
print_int c; print_string ":"
| Noinf -> print_string "<Unknown file and line>: "
let error fi s =
print_info fi ;
print_string " " ;
print_string s ;
print_newline () ;
exit 0
let err s =
print_string s ;
print_newline () ;
exit 0
let error_no_exit fi s =
print_info fi ;
print_string " " ;
print_string s ;
print_newline () ;
raise Dummy