summaryrefslogtreecommitdiff
path: root/caml/Main2.ml
diff options
context:
space:
mode:
Diffstat (limited to 'caml/Main2.ml')
-rw-r--r--caml/Main2.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/caml/Main2.ml b/caml/Main2.ml
index b701419..4181575 100644
--- a/caml/Main2.ml
+++ b/caml/Main2.ml
@@ -6,7 +6,9 @@ let process_cminor_file sourcename =
let ic = open_in sourcename in
let lb = Lexing.from_channel ic in
try
- match Main.transf_cminor_program (CMparser.prog CMlexer.token lb) with
+ match Main.transf_cminor_program
+ (CMtypecheck.type_program
+ (CMparser.prog CMlexer.token lb)) with
| None ->
eprintf "Compiler failure\n";
exit 2
@@ -22,6 +24,10 @@ let process_cminor_file sourcename =
eprintf "File %s, character %d: %s\n"
sourcename (Lexing.lexeme_start lb) msg;
exit 2
+ | CMtypecheck.Error msg ->
+ eprintf "File %s, type-checking error:\n%s"
+ sourcename msg;
+ exit 2
let process_file filename =
if Filename.check_suffix filename ".cm" then