summaryrefslogtreecommitdiff
path: root/src/process_file.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-06-22 18:11:32 +0100
committerAlasdair Armstrong2017-06-22 18:11:32 +0100
commit41c5ae82e46fe06ab3a16d0759872a5a221f2da2 (patch)
tree9526c1bf4df2ab5477f4a23d03831c21bc1980ff /src/process_file.ml
parent0af6fd21fdba71f7aae6d95ec758fdf86e4916a7 (diff)
Can now typecheck register declarations and assignments
Can now properly typecheck register declarations and assignments. Also better support for assignments to mutable variables. Assignment to immutable let bound variables is disallowed as it should be, and casts when assiging to existing bound variables should be handled properly. Added additional tests for these new features, and a new option -just_check that allows the new checker to be run without the old.
Diffstat (limited to 'src/process_file.ml')
-rw-r--r--src/process_file.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/process_file.ml b/src/process_file.ml
index 12a067e1..63e42219 100644
--- a/src/process_file.ml
+++ b/src/process_file.ml
@@ -89,6 +89,7 @@ let initi_check_ast (defs : Type_internal.tannot Ast.defs) : (Type_internal.tann
Initial_check_full_ast.to_checked_ast Nameset.empty Type_internal.initial_kind_env (Ast.Ord_aux(Ast.Ord_inc,Parse_ast.Unknown)) defs
let opt_new_typecheck = ref false
+let opt_just_check = ref false
let check_ast (defs : Type_internal.tannot Ast.defs) (k : kind Envmap.t) (o:Ast.order) : Type_internal.tannot Ast.defs * Type_check.envs =
let d_env = { Type_internal.k_env = k; Type_internal.abbrevs = Type_internal.initial_abbrev_env;
@@ -102,6 +103,9 @@ let check_ast (defs : Type_internal.tannot Ast.defs) (k : kind Envmap.t) (o:Ast.
if !opt_new_typecheck
then let _ = Type_check_new.check Type_check_new.initial_env defs in ()
else ();
+ if !opt_just_check
+ then exit 0
+ else ();
Type_check.check (Type_check.Env (d_env, Type_internal.initial_typ_env,Type_internal.nob,Envmap.empty)) defs
let rewrite_ast (defs: Type_internal.tannot Ast.defs) = Rewriter.rewrite_defs defs