summaryrefslogtreecommitdiff
path: root/src/process_file.ml
diff options
context:
space:
mode:
authorKathy Gray2014-01-17 19:53:33 +0000
committerKathy Gray2014-01-17 19:53:46 +0000
commit9ee67ed106808b5e82d5942e4d782fbf8cd133cd (patch)
tree60e32496edc0d49ba99d68739db52c375cdad16c /src/process_file.ml
parent828f19828e41ced146f06e9a7eb4183cd9ef3ab4 (diff)
Type check through type definitions and val specifications, building definition environment. Skipping function definition, let bind, and expression checking for this commit (to come).
Diffstat (limited to 'src/process_file.ml')
-rw-r--r--src/process_file.ml9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/process_file.ml b/src/process_file.ml
index b07caca4..29635f91 100644
--- a/src/process_file.ml
+++ b/src/process_file.ml
@@ -87,9 +87,16 @@ let parse_file (f : string) : Parse_ast.defs =
| Lexer.LexError(s,p) ->
raise (Reporting_basic.Fatal_error (Reporting_basic.Err_lex (p, s)))
-let convert_ast (defs : Parse_ast.defs) : Type_internal.tannot Ast.defs =
+let convert_ast (defs : Parse_ast.defs) : (Type_internal.tannot Ast.defs * kind Envmap.t)=
Initial_check.to_ast Nameset.empty Type_internal.initial_kind_env Envmap.empty defs
+
+let check_ast (defs : Type_internal.tannot Ast.defs) (k : kind Envmap.t) : Type_internal.tannot Ast.defs =
+ let d_env = { Type_check.k_env = k; Type_check.abbrevs = Envmap.empty;
+ Type_check.namesch = Envmap.empty; Type_check.enum_env = Envmap.empty;
+ Type_check.rec_env = []; } in
+ Type_check.check (Type_check.Env (d_env, Type_internal.initial_typ_env)) defs
+
let open_output_with_check file_name =
let (temp_file_name, o) = Filename.open_temp_file "ll_temp" "" in
let o' = Format.formatter_of_out_channel o in