Skip to content

Commit

Permalink
Fix mapping of intervals in Ast_mapper (#10543)
Browse files Browse the repository at this point in the history
Co-authored-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
  • Loading branch information
gpetiot and nojb committed Jul 29, 2021
1 parent 278ec73 commit b37bd8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ OCaml 4.13.0
- #10307: Make build_other_constrs work with names instead of tags.
(Nicolas Chataing, review by Florian Angeletti)

- #10543: Fix Ast_mapper to apply the mapping function to the constants in
"interval" patterns `c1..c2`.
(Guillaume Petiot, review by Gabriel Scherer and Nicolás Ojeda Bär)

### Build system:

- #10289, #10406: Do not print option documentation in usage messages.
Expand Down
3 changes: 2 additions & 1 deletion parsing/ast_mapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ module P = struct
| Ppat_var s -> var ~loc ~attrs (map_loc sub s)
| Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
| Ppat_constant c -> constant ~loc ~attrs (sub.constant sub c)
| Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
| Ppat_interval (c1, c2) ->
interval ~loc ~attrs (sub.constant sub c1) (sub.constant sub c2)
| Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
| Ppat_construct (l, p) ->
construct ~loc ~attrs (map_loc sub l)
Expand Down

0 comments on commit b37bd8a

Please sign in to comment.