aboutsummaryrefslogtreecommitdiff
path: root/src/boot/me/semant.ml
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-09-16 15:03:28 -0700
committerGraydon Hoare <[email protected]>2010-09-16 15:04:40 -0700
commit9dac49bcd613213347e1a6beba25d64bea2596b7 (patch)
treec0235b9f89b23a1c7a250afc307fcdc12e2b37e4 /src/boot/me/semant.ml
parentPopulate the tag containment relation (diff)
downloadrust-9dac49bcd613213347e1a6beba25d64bea2596b7.tar.xz
rust-9dac49bcd613213347e1a6beba25d64bea2596b7.zip
Resolve plvals to their defns.
Diffstat (limited to 'src/boot/me/semant.ml')
-rw-r--r--src/boot/me/semant.ml11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml
index cde590c9..01457454 100644
--- a/src/boot/me/semant.ml
+++ b/src/boot/me/semant.ml
@@ -577,6 +577,17 @@ let rec lval_to_name (lv:Ast.lval) : Ast.name =
Ast.NAME_ext (lval_to_name lv, comp)
;;
+let rec plval_to_name (pl:Ast.plval) : Ast.name =
+ match pl with
+ Ast.PLVAL_ident ident ->
+ Ast.NAME_base (Ast.BASE_ident ident)
+ | Ast.PLVAL_app (ident, tys) ->
+ Ast.NAME_base (Ast.BASE_app (ident, tys))
+ | Ast.PLVAL_ext_name ({node = Ast.PEXP_lval pl}, nc) ->
+ Ast.NAME_ext (plval_to_name pl, nc)
+ | _ -> bug () "plval_to_name with plval that contains non-name components"
+;;
+
(* Type extraction. *)