summaryrefslogtreecommitdiff
path: root/src/ast_util.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast_util.ml')
-rw-r--r--src/ast_util.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ast_util.ml b/src/ast_util.ml
index 8b51edd3..955c147f 100644
--- a/src/ast_util.ml
+++ b/src/ast_util.ml
@@ -439,6 +439,25 @@ and map_pat_annot_aux f = function
| P_vector pats -> P_vector (List.map (map_pat_annot f) pats)
| P_cons (pat1, pat2) -> P_cons (map_pat_annot f pat1, map_pat_annot f pat2)
| P_string_append (pat1, pat2) -> P_string_append (map_pat_annot f pat1, map_pat_annot f pat2)
+
+and map_mpexp_annot f (MPat_aux (mpexp, annot)) = MPat_aux (map_mpexp_annot_aux f mpexp, f annot)
+and map_mpexp_annot_aux f = function
+ | MPat_pat mpat -> MPat_pat (map_mpat_annot f mpat)
+ | MPat_when (mpat, guard) -> MPat_when (map_mpat_annot f mpat, map_exp_annot f guard)
+
+and map_mpat_annot f (MP_aux (mpat, annot)) = MP_aux (map_mpat_annot_aux f mpat, f annot)
+and map_mpat_annot_aux f = function
+ | MP_lit lit -> MP_lit lit
+ | MP_id id -> MP_id id
+ | MP_app (id, mpats) -> MP_app (id, List.map (map_mpat_annot f) mpats)
+ | MP_record (fmpats, b) -> MP_record (List.map (map_fpat_annot f) fmpats, b)
+ | MP_tup mpats -> MP_tup (List.map (map_mpat_annot f) mpats)
+ | MP_list mpats -> MP_list (List.map (map_mpat_annot f) mpats)
+ | MP_vector_concat mpats -> MP_vector_concat (List.map (map_mpat_annot f) mpats)
+ | MP_vector mpats -> MP_vector (List.map (map_mpat_annot f) mpats)
+ | MP_cons (mpat1, mpat2) -> MP_cons (map_mpat_annot f mpat1, map_mpat_annot f mpat2)
+ | MP_string_append (mpat1, mpat2) -> MP_string_append (map_mpat_annot f mpat1, map_mpat_annot f mpat2)
+
and map_fpat_annot f (FP_aux (FP_Fpat (id, pat), annot)) = FP_aux (FP_Fpat (id, map_pat_annot f pat), f annot)
and map_letbind_annot f (LB_aux (lb, annot)) = LB_aux (map_letbind_annot_aux f lb, f annot)
and map_letbind_annot_aux f = function