summaryrefslogtreecommitdiff
path: root/src/initial_check_full_ast.ml
diff options
context:
space:
mode:
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)