aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2017-09-04 13:39:17 +0200
committerPierre-Marie Pédrot2017-09-04 13:41:58 +0200
commite634eb23010a3dee3fddcdd3d7d5588c3b40e1f6 (patch)
tree391f4a01760520201b7f0922d3306d8bb74b9673 /tests
parent102cfe76bc42d3139c79eca59eb782fcf644317b (diff)
Implementing multi-match and simple match over constrs.
Diffstat (limited to 'tests')
-rw-r--r--tests/matching.v10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/matching.v b/tests/matching.v
index d21c505cdf..f43e0121ef 100644
--- a/tests/matching.v
+++ b/tests/matching.v
@@ -14,4 +14,14 @@ in
it commits to a branch*)
lazy_match! '(nat -> bool) with context [?a] => f a end.
lazy_match! Control.goal () with ?a -> ?b => Message.print (Message.of_constr b) end.
+
+(** This one works by taking the second match context, i.e. ?a := nat *)
+let b := { contents := true } in
+let f c :=
+ match b.(contents) with
+ | true => b.(contents) := false; fail
+ | false => Message.print (Message.of_constr c)
+ end
+in
+match! '(nat -> bool) with context [?a] => f a end.
Abort.