aboutsummaryrefslogtreecommitdiff
path: root/src/boot/me/semant.ml
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-07-28 14:00:44 -0700
committerRoy Frostig <[email protected]>2010-07-28 14:00:44 -0700
commit596d19e2ea1f2cc96f7e493171a692bc0b912ce6 (patch)
treef9a4be20be28121856a359e31ba0d07c56bf1213 /src/boot/me/semant.ml
parentSwitch machine-type lexemes to use suffixes. Remove support for foo(bar) as a... (diff)
downloadrust-596d19e2ea1f2cc96f7e493171a692bc0b912ce6.tar.xz
rust-596d19e2ea1f2cc96f7e493171a692bc0b912ce6.zip
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.
Diffstat (limited to 'src/boot/me/semant.ml')
-rw-r--r--src/boot/me/semant.ml17
1 files changed, 17 insertions, 0 deletions
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)