summaryrefslogtreecommitdiff
path: root/src/initial_check_full_ast.ml
diff options
context:
space:
mode:
authorKathy Gray2016-08-14 12:37:46 +0100
committerKathy Gray2016-08-14 12:37:46 +0100
commitac9aa3b73181cf6f8a0bbcf2c59562ec17c7c8ea (patch)
tree18ca622f78c0fd51ff0c8b85b3b02c4a4dc9fe57 /src/initial_check_full_ast.ml
parent5c31607a52606cd5671d7d65627ac37cc9f117c8 (diff)
Start adding form for (a,b,c) := foo()
Not working yet
Diffstat (limited to 'src/initial_check_full_ast.ml')
-rw-r--r--src/initial_check_full_ast.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/initial_check_full_ast.ml b/src/initial_check_full_ast.ml
index 1443af5d..562d778e 100644
--- a/src/initial_check_full_ast.ml
+++ b/src/initial_check_full_ast.ml
@@ -381,6 +381,15 @@ and to_lexp (k_env : kind Envmap.t) (def_ord : Ast.order) (LEXP_aux(exp,(l,_)) :
| args -> LEXP_memory(f, args))
| LEXP_cast(typ,id) ->
LEXP_cast(to_typ k_env def_ord typ, id)
+ | LEXP_tup tups ->
+ let ltups = List.map (to_lexp k_env def_ord) tups in
+ let is_ok_in_tup (LEXP_aux (le,(l,_))) =
+ match le with
+ | LEXP_id _ | LEXP_cast _ | LEXP_vector _ | LEXP_field _ | LEXP_vector_range _ | LEXP_tup _ -> ()
+ | LEXP_memory _ ->
+ typ_error l "only identifiers, fields, and vectors may be set in a tuple" None None None in
+ List.iter is_ok_in_tup ltups;
+ LEXP_tup(ltups)
| LEXP_vector(vexp,exp) -> LEXP_vector(to_lexp k_env def_ord vexp, to_exp k_env def_ord exp)
| LEXP_vector_range(vexp,exp1,exp2) ->
LEXP_vector_range(to_lexp k_env def_ord vexp, to_exp k_env def_ord exp1, to_exp k_env def_ord exp2)