From 54662db2f63947f337cb4a681ddd7af19f1e7f8d Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Tue, 8 Oct 2019 18:02:43 +0200 Subject: [PATCH] use simpl_projection to build accessor --- src/passes/2-simplify/pascaligo.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 6071da798..1b45c8c20 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -771,9 +771,8 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu let%bind (varname,map,path) = match v'.path with | Name name -> ok (name.value , e_variable name.value, []) | Path p -> - let expr = e_variable p.value.struct_name.value in let (_,p') = simpl_path v'.path in - let accessor = e_accessor expr p' in + let%bind accessor = simpl_projection p in ok @@ (p.value.struct_name.value , accessor , p') in let%bind key_expr = simpl_expression v'.index.value.inside in @@ -828,9 +827,8 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu let%bind (varname,map,path) = match v.map with | Name v -> ok (v.value , e_variable v.value , []) | Path p -> - let expr = e_variable p.value.struct_name.value in let (_,p') = simpl_path v.map in - let accessor = e_accessor expr p' in + let%bind accessor = simpl_projection p in ok @@ (p.value.struct_name.value , accessor , p') in let%bind key' = simpl_expression key in