Project

General

Profile

Revision a28d1ba7 src/lusic.ml

View differences:

src/lusic.ml
46 46
let check_obsolete lusic basename =
47 47
  if lusic.obsolete then raise (Error (Location.dummy_loc, Wrong_number basename))
48 48

  
49
let check_lusic lusic basename =
50
  try
51
    check_obsolete lusic basename
52
  with
53
  | Corelang.Error (loc, err) as exc -> (
54
    eprintf "Library error: %a%a@."
55
      Corelang.pp_error err
56
      Location.pp_loc loc;
57
    raise exc
58
  )
59

  
60 49
(* encode and write a header in a file *)
61 50
let write_lusic lusi (header : top_decl list) basename extension =
62 51
  let target_name = basename ^ extension in
......
99 88
  let h_out = open_out header_name in
100 89
  let h_fmt = formatter_of_out_channel h_out in
101 90
  begin
102
    check_lusic lusic basename;
91
    assert (not lusic.obsolete);
103 92
    Typing.uneval_prog_generics lusic.contents;
104 93
    Clock_calculus.uneval_prog_generics lusic.contents;
105 94
    Header.print_header_from_header h_fmt (Filename.basename basename) lusic.contents;

Also available in: Unified diff