forked from YannickChevalier/hevea-mathjax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesponja.ml
63 lines (56 loc) · 1.88 KB
/
esponja.ml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
(***********************************************************************)
(* *)
(* HEVEA *)
(* *)
(* Luc Maranget, projet Moscova, INRIA Rocquencourt *)
(* *)
(* Copyright 2001 Institut National de Recherche en Informatique et *)
(* Automatique. Distributed only by permission. *)
(* *)
(***********************************************************************)
open Printf
let arg = ref []
let pess = ref false
let move = ref true
let small_length = ref 1024
let () =
Arg.parse
[
("-version", Arg.Unit
(fun () ->
print_endline ("esponja "^Version.version) ;
print_endline ("library directory: "^Mylib.static_libdir) ;
exit 0),
"show version and exit") ;
("-rsz", Arg.Int (fun i -> small_length := i),
(sprintf
"size of leaves in rope implementation (default %i)"
!small_length)) ;
"-u", Arg.Set pess, "pessimize" ;
"-v", Arg.Unit (fun () -> incr Emisc.verbose),"be verbose" ;
"-n", Arg.Unit (fun () -> move := false ; incr Emisc.verbose),
"do not change files"; ]
(fun s -> arg := s :: !arg)
("Usage: esponja [option*] files\noptions are:")
;;
module E =
Esp.Make
(struct
let pess = !pess
let move = !move
let small_length = !small_length
end)
let process name = try E.file name with Esp.Failed -> ()
let main () =
(* try *)
List.iter process (List.rev !arg) ;
exit 0
(* with
| e ->
Printf.fprintf stderr "Unexpected exception: %s\n"
(Printexc.to_string e) ;
exit 2
*)
;;
main ()
;;