diff options
author | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2017-11-15 21:44:32 +0100 |
---|---|---|
committer | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2017-11-20 20:19:45 +0100 |
commit | ab7fd497575b161eeb9bfe89da743b3fbc93aaf3 (patch) | |
tree | 4f95d0ae3300db7fd8aadd2406b203ec46226506 /test-suite/success/Notations2.v | |
parent | 2a857da2a88855a6c9f0fa7e48a8700c1613e0c7 (diff) |
Fixing factorization of recursive notations in the case of an atomic separator.
This addresses a limitation found in math-comp seq.v file. See the example in
test suite file success/Notations2.v.
To go further and accept recursive notations with a separator made of
several tokens, and assuming camlp5 unchanged, one would need to
declare an auxiliary entry for this sequence of tokens and use it as
an "atomic" (non-terminal) separator. See PR #6167 for details.
Diffstat (limited to 'test-suite/success/Notations2.v')
-rw-r--r-- | test-suite/success/Notations2.v | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test-suite/success/Notations2.v b/test-suite/success/Notations2.v index e86b3edb8..2655b651a 100644 --- a/test-suite/success/Notations2.v +++ b/test-suite/success/Notations2.v @@ -96,3 +96,12 @@ Check fun A (x :prod' bool A) => match x with ##### 0 _ y 0%bool => 2 | _ => 1 e Notation "'FUNNAT' i => t" := (fun i : nat => i = t) (at level 200). Notation "'Funnat' i => t" := (FUNNAT i => t + i%nat) (at level 200). + +(* 11. Notations with needed factorization of a recursive pattern *) +(* See https://github.com/coq/coq/issues/6078#issuecomment-342287412 *) +Module A. +Notation "[:: x1 ; .. ; xn & s ]" := (cons x1 .. (cons xn s) ..). +Notation "[:: x1 ; .. ; xn ]" := (cons x1 .. (cons xn nil) ..). +Check [:: 1 ; 2 ; 3 ]. +Check [:: 1 ; 2 ; 3 & nil ]. (* was failing *) +End A. |