use simpl_projection to build accessor

This commit is contained in:
Lesenechal Remi 2019-10-08 18:02:43 +02:00
parent d59cd771c9
commit 54662db2f6

View File

@ -771,9 +771,8 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu
let%bind (varname,map,path) = match v'.path with let%bind (varname,map,path) = match v'.path with
| Name name -> ok (name.value , e_variable name.value, []) | Name name -> ok (name.value , e_variable name.value, [])
| Path p -> | Path p ->
let expr = e_variable p.value.struct_name.value in
let (_,p') = simpl_path v'.path 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') ok @@ (p.value.struct_name.value , accessor , p')
in in
let%bind key_expr = simpl_expression v'.index.value.inside 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 let%bind (varname,map,path) = match v.map with
| Name v -> ok (v.value , e_variable v.value , []) | Name v -> ok (v.value , e_variable v.value , [])
| Path p -> | Path p ->
let expr = e_variable p.value.struct_name.value in
let (_,p') = simpl_path v.map 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') ok @@ (p.value.struct_name.value , accessor , p')
in in
let%bind key' = simpl_expression key in let%bind key' = simpl_expression key in