aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/success/Notations.v
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2015-11-26 19:05:25 +0100
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2015-11-26 19:13:13 +0100
commit982460743a54ecfab1d601ba930d61c04972d17a (patch)
tree92c2527ce3f57556df6527a11e5e3351b316f73f /test-suite/success/Notations.v
parent11ccb7333c2a82d59736027838acaea2237e2402 (diff)
Fixing the "parsing rules with idents later declared as keywords" problem.
The fix was actually elementary. The lexer comes with a function to compare parsed tokens against tokens of the parsing rules. It is enough to have this function considering an ident in a parsing rule to be equal to the corresponding string parsed as a keyword.
Diffstat (limited to 'test-suite/success/Notations.v')
-rw-r--r--test-suite/success/Notations.v6
1 files changed, 6 insertions, 0 deletions
diff --git a/test-suite/success/Notations.v b/test-suite/success/Notations.v
index 2371d32cd..b72a06740 100644
--- a/test-suite/success/Notations.v
+++ b/test-suite/success/Notations.v
@@ -101,3 +101,9 @@ Fail Check fun x => match x with S (FORALL x, _) => 0 end.
Parameter traverse : (nat -> unit) -> (nat -> unit).
Notation traverse_var f l := (traverse (fun l => f l) l).
+
+(* Check that when an ident become a keyword, it does not break
+ previous rules relying on the string to be classified as an ident *)
+
+Notation "'intros' x" := (S x) (at level 0).
+Goal True -> True. intros H. exact H. Qed.