From 596d19e2ea1f2cc96f7e493171a692bc0b912ce6 Mon Sep 17 00:00:00 2001 From: Roy Frostig Date: Wed, 28 Jul 2010 14:00:44 -0700 Subject: Test the deque a bit. Give it a get-by-index method. Fix two uncovered state-calculation bugs --- one decently, the other with an ugly hack. Bug on the latter coming right up. --- src/boot/me/semant.ml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/boot/me/semant.ml') diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml index 16331e36..bcaec2b4 100644 --- a/src/boot/me/semant.ml +++ b/src/boot/me/semant.ml @@ -1061,6 +1061,23 @@ let rec simplified_ty (t:Ast.ty) : Ast.ty = | t -> t ;; +let rec innermost_box_ty (t:Ast.ty) : Ast.ty = + match strip_mutable_or_constrained_ty t with + Ast.TY_box t -> innermost_box_ty t + | _ -> t +;; + +let simplified_ty_innermost_was_mutable (t:Ast.ty) : Ast.ty * bool = + let rec simplify_innermost t = + match t with + Ast.TY_mutable t -> (fst (simplify_innermost t), true) + | Ast.TY_constrained (t, _) -> simplify_innermost t + | _ -> (t, false) + in + let t = innermost_box_ty t in + simplify_innermost t +;; + let rec project_type (base_ty:Ast.ty) (comp:Ast.lval_component) -- cgit v1.2.3