~ubuntu-branches/ubuntu/trusty/sexplib310/trusty

« back to all changes in this revision

Viewing changes to top/sexplib_install_printers.ml

  • Committer: Package Import Robot
  • Author(s): Stéphane Glondu
  • Date: 2013-12-03 21:36:45 UTC
  • mfrom: (11.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20131203213645-h1if1c6hxual8p11
Tags: 109.20.00-2
* Team upload
* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
let printers = [ "Sexplib.Sexp.pp_hum" ]
 
2
 
 
3
let eval_string
 
4
      ?(print_outcome = false) ?(err_formatter = Format.err_formatter) str =
 
5
  let lexbuf = Lexing.from_string str in
 
6
  let phrase = !Toploop.parse_toplevel_phrase lexbuf in
 
7
  Toploop.execute_phrase print_outcome err_formatter phrase
 
8
 
 
9
let rec install_printers = function
 
10
  | [] -> true
 
11
  | printer :: printers ->
 
12
      let cmd = Printf.sprintf "#install_printer %s;;" printer in
 
13
      eval_string cmd && install_printers printers
 
14
 
 
15
let () =
 
16
  if not (install_printers printers) then
 
17
    Format.eprintf "Problem installing Sexplib-printers@."