Allow '_' to be used to ignore more types of bitstring when matching.
authorRichard W.M. Jones <rich@annexia.org>
Sun, 18 May 2008 16:13:09 +0000 (16:13 +0000)
committerRichard W.M. Jones <rich@annexia.org>
Sun, 18 May 2008 16:13:09 +0000 (16:13 +0000)
pa_bitmatch.ml

index d5945e0..9a25da8 100644 (file)
@@ -657,6 +657,7 @@ let output_bitmatch _loc bs cases =
              let ident =
                match fpatt with
                | <:patt< $lid:ident$ >> -> ident
+               | <:patt< _ >> -> "_"
                | _ ->
                    Loc.raise _loc
                      (Failure "cannot compare a bitstring to a constant") in
@@ -676,6 +677,7 @@ let output_bitmatch _loc bs cases =
              let ident =
                match fpatt with
                | <:patt< $lid:ident$ >> -> ident
+               | <:patt< _ >> -> "_"
                | _ ->
                    Loc.raise _loc
                      (Failure "cannot compare a bitstring to a constant") in