diff options
author | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2017-11-23 13:30:36 +0100 |
---|---|---|
committer | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2018-02-20 10:03:07 +0100 |
commit | 0c4eea2553d5b3b70d0b5baaf92781a544de83bd (patch) | |
tree | c39bf3bff29cd7b8bb68b503ce53df7e6f382215 /test-suite/output | |
parent | dcfd5c2c2cefcd8ae6a5b2e90fcbd98da4f1b120 (diff) |
Change default for notations with variables bound to both terms and binders.
For compatibility, the default is to parse as ident and not as pattern.
Diffstat (limited to 'test-suite/output')
-rw-r--r-- | test-suite/output/Notations3.out | 6 | ||||
-rw-r--r-- | test-suite/output/Notations3.v | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test-suite/output/Notations3.out b/test-suite/output/Notations3.out index 3fd4c1c31..436e97e9f 100644 --- a/test-suite/output/Notations3.out +++ b/test-suite/output/Notations3.out @@ -219,3 +219,9 @@ fun p : nat => if p is S n then n else 0 : nat -> nat fun p : comparison => if p is Lt then 1 else 0 : comparison -> nat +fun S : nat => [S | S + S] + : nat -> nat * (nat -> nat) +fun N : nat => [N | N + 0] + : nat -> nat * (nat -> nat) +fun S : nat => [[S | S + S]] + : nat -> nat * (nat -> nat) diff --git a/test-suite/output/Notations3.v b/test-suite/output/Notations3.v index 9ea218481..df3d86793 100644 --- a/test-suite/output/Notations3.v +++ b/test-suite/output/Notations3.v @@ -389,3 +389,15 @@ Notation "'if' c 'is' p 'then' u 'else' v" := (at level 200, p pattern at level 100). Check fun p => if p is S n then n else 0. Check fun p => if p is Lt then 1 else 0. + +(* Check that mixed binders and terms defaults to ident and not pattern *) +Module E. + (* First without an indirection *) +Notation "[ n | t ]" := (n, (fun n : nat => t)). +Check fun S : nat => [ S | S+S ]. +Check fun N : nat => (N, (fun n => n+0)). (* another test in passing *) + (* Then with an indirection *) +Notation "[[ n | p | t ]]" := (n, (fun p : nat => t)). +Notation "[[ n | t ]]" := [[ n | n | t ]]. +Check fun S : nat => [[ S | S+S ]]. +End E. |