summaryrefslogtreecommitdiff
path: root/src/initial_check.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-08-15 13:50:21 +0100
committerAlasdair Armstrong2017-08-15 13:50:21 +0100
commit609a48d32a316fc2cb0578ebe84bc479c729cc66 (patch)
tree97ca05d4097be6ea4711ff03679109c8ad49c04c /src/initial_check.ml
parentf05423c1947df0432362172ba9cfd00c4b8680c0 (diff)
Added exceptions and try/catch blocks to AST and typechecker in order
to translate exceptions in ASL. See test/typecheck/pass/trycatch.sail.
Diffstat (limited to 'src/initial_check.ml')
-rw-r--r--src/initial_check.ml2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/initial_check.ml b/src/initial_check.ml
index 1db9d80b..aeca186d 100644
--- a/src/initial_check.ml
+++ b/src/initial_check.ml
@@ -498,11 +498,13 @@ and to_ast_exp (k_env : kind Envmap.t) (def_ord : order) (Parse_ast.E_aux(exp,l)
| _ -> raise (Reporting_basic.err_unreachable l "to_ast_fexps with true returned none"))
| Parse_ast.E_field(exp,id) -> E_field(to_ast_exp k_env def_ord exp, to_ast_id id)
| Parse_ast.E_case(exp,pexps) -> E_case(to_ast_exp k_env def_ord exp, List.map (to_ast_case k_env def_ord) pexps)
+ | Parse_ast.E_try (exp, pexps) -> E_try (to_ast_exp k_env def_ord exp, List.map (to_ast_case k_env def_ord) pexps)
| Parse_ast.E_let(leb,exp) -> E_let(to_ast_letbind k_env def_ord leb, to_ast_exp k_env def_ord exp)
| Parse_ast.E_assign(lexp,exp) -> E_assign(to_ast_lexp k_env def_ord lexp, to_ast_exp k_env def_ord exp)
| Parse_ast.E_sizeof(nexp) -> E_sizeof(to_ast_nexp k_env nexp)
| Parse_ast.E_constraint nc -> E_constraint (to_ast_nexp_constraint k_env nc)
| Parse_ast.E_exit exp -> E_exit(to_ast_exp k_env def_ord exp)
+ | Parse_ast.E_throw exp -> E_throw (to_ast_exp k_env def_ord exp)
| Parse_ast.E_return exp -> E_return(to_ast_exp k_env def_ord exp)
| Parse_ast.E_assert(cond,msg) -> E_assert(to_ast_exp k_env def_ord cond, to_ast_exp k_env def_ord msg)
), (l,()))