Skip to content

Commit

Permalink
fix(compiler): Iterate over guard clauses in typedTreeIter/typedTreeM…
Browse files Browse the repository at this point in the history
  • Loading branch information
peblair authored May 29, 2022
1 parent d3e7a33 commit 96e8ecb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion compiler/src/typed/typedtreeIter.re
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ module MakeIterator =
Iter.leave_bindings(rec_flag, mut_flag);
}

and iter_match_branch = ({mb_pat, mb_body}) => {
and iter_match_branch = ({mb_pat, mb_body, mb_guard}) => {
iter_pattern(mb_pat);
iter_expression(mb_body);
Option.iter(iter_expression, mb_guard);
}

and iter_match_branches = branches => List.iter(iter_match_branch, branches)
Expand Down
5 changes: 3 additions & 2 deletions compiler/src/typed/typedtreeMap.re
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ module MakeMap =
and map_bindings = (rec_flag, mut_flag, binds) =>
List.map(map_binding, binds)

and map_match_branch = ({mb_pat, mb_body} as mb) => {
and map_match_branch = ({mb_pat, mb_body, mb_guard} as mb) => {
let mb_pat = map_pattern(mb_pat);
let mb_body = map_expression(mb_body);
{...mb, mb_pat, mb_body};
let mb_guard = Option.map(map_expression, mb_guard);
{...mb, mb_pat, mb_body, mb_guard};
}

and map_match_branches = branches => List.map(map_match_branch, branches)
Expand Down

0 comments on commit 96e8ecb

Please sign in to comment.