summaryrefslogtreecommitdiff
path: root/main.ml
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-22 02:47:29 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-22 02:47:29 +0100
commit20494686e2ac5960a913ddf6c6c9de2660592790 (patch)
treefc4d74106cd35d30ff0276558d4c5c635a4092dc /main.ml
parent2da043cdd5be558fe6bc1e14f5a8b8abea21a412 (diff)
downloadpetitcaml-20494686e2ac5960a913ddf6c6c9de2660592790.tar.gz
petitcaml-20494686e2ac5960a913ddf6c6c9de2660592790.tar.bz2
[petitcaml] Add top level types printing option
Diffstat (limited to 'main.ml')
-rw-r--r--main.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.ml b/main.ml
index 84b1f33..4d7d7da 100644
--- a/main.ml
+++ b/main.ml
@@ -10,6 +10,7 @@ open Ast
let parse_only = ref false
let type_only = ref false
let verbose = ref false
+let printtypes = ref false
let verbose_assembly = ref false
let ifile = ref ""
@@ -23,8 +24,10 @@ let options =
" Arrête la compilation après la phase d'analyse syntaxique";
"-type-only", Arg.Set type_only,
" Arrête la compilation après la phase d'analyse sémantique";
- "-v", Arg.Set verbose,
+ "-v", Arg.Set verbose,
" Affiche des informations supplémentaires sur la compilation";
+ "-print-decl-types", Arg.Set printtypes,
+ " Affiche les types des déclarations de plus haut niveau";
"-verbose-assembly", Arg.Set verbose_assembly,
" Active les commentaires du code assembleur produit";
"-o", Arg.String (set_file ofile),
@@ -101,6 +104,7 @@ let _ =
let _ = Typing.type_ast a
in
if !verbose then Utils.display_ast a;
+ if !printtypes then Utils.print_types a;
if !type_only then exit 0;