Revision a28d1ba7
Added by Xavier Thirioux almost 10 years ago
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
some cosmetic changes in error messages when loading libraries
git-svn-id: https://cavale.enseeiht.fr/svn/lustrec/lustre_compiler/trunk@444 041b043f-8d7c-46b2-b46e-ef0dd855326e