Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mapping of intervals in Ast_mapper #10543

Merged
merged 2 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,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 @@ -486,7 +486,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