aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-11-07 08:35:33 +0100
committerPierre-Marie Pédrot2019-11-07 08:35:33 +0100
commit5c5831e35747f25d8aeadf10a13cd60e9b7adfbb (patch)
treefe091a887b2b479a15e27a5f95185e1dbc4fd8c2
parent6043b49f06a77763e8cdaabc81c1d6e6156cfeaa (diff)
parente3fb17911c74cfde61367c8558bd0926642280c9 (diff)
Merge PR #11059: Swap parsing precedence of `::` and `,` ; Fix #10116
Reviewed-by: ppedrot
-rw-r--r--test-suite/bugs/closed/bug_10116.v3
-rw-r--r--user-contrib/Ltac2/g_ltac2.mlg6
2 files changed, 6 insertions, 3 deletions
diff --git a/test-suite/bugs/closed/bug_10116.v b/test-suite/bugs/closed/bug_10116.v
new file mode 100644
index 0000000000..58caa59786
--- /dev/null
+++ b/test-suite/bugs/closed/bug_10116.v
@@ -0,0 +1,3 @@
+From Ltac2 Require Import Ltac2.
+
+Ltac2 Eval true :: [], false.
diff --git a/user-contrib/Ltac2/g_ltac2.mlg b/user-contrib/Ltac2/g_ltac2.mlg
index 9d4a3706f4..cc3a7c0f79 100644
--- a/user-contrib/Ltac2/g_ltac2.mlg
+++ b/user-contrib/Ltac2/g_ltac2.mlg
@@ -175,13 +175,13 @@ GRAMMAR EXTEND Gram
{ CAst.make ~loc @@ CTacCse (e, bl) }
]
| "4" LEFTA [ ]
+ | [ e0 = SELF; ","; el = LIST1 NEXT SEP "," ->
+ { let el = e0 :: el in
+ CAst.make ~loc @@ CTacApp (CAst.make ~loc @@ CTacCst (AbsKn (Tuple (List.length el))), el) } ]
| "::" RIGHTA
[ e1 = tac2expr; "::"; e2 = tac2expr ->
{ CAst.make ~loc @@ CTacApp (CAst.make ~loc @@ CTacCst (AbsKn (Other Tac2core.Core.c_cons)), [e1; e2]) }
]
- | [ e0 = SELF; ","; el = LIST1 NEXT SEP "," ->
- { let el = e0 :: el in
- CAst.make ~loc @@ CTacApp (CAst.make ~loc @@ CTacCst (AbsKn (Tuple (List.length el))), el) } ]
| "1" LEFTA
[ e = tac2expr; el = LIST1 tac2expr LEVEL "0" ->
{ CAst.make ~loc @@ CTacApp (e, el) }