Skip to content

Commit

Permalink
Fix translation of iterated ids in il2al
Browse files Browse the repository at this point in the history
  • Loading branch information
jaehyun1ee committed Jan 29, 2024
1 parent a7b6030 commit 38d2b70
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spectec/src/il2al/translate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,9 @@ let rec iterpr2instrs pr (iter, ids) =
let at = i.at in
match i.it with
| LetI (lhs, rhs) -> [ letI (distribute_iter lhs rhs) ~at:at ]
| IfI (cond, il1, il2) -> [ ifI (iterE (cond, ids', iter') ~at:cond.at, il1, il2) ~at:at ]
| IfI (cond, il1, il2) ->
let cond_ids = intersection (free_expr cond) ids' in
[ ifI (iterE (cond, cond_ids, iter') ~at:cond.at, il1, il2) ~at:at ]
| _ -> [ i ]
in
let walk_config = { Al.Walk.default_config with post_instr = f } in
Expand Down

0 comments on commit 38d2b70

Please sign in to comment.