aboutsummaryrefslogtreecommitdiff
path: root/parsing/pcoq.ml
diff options
context:
space:
mode:
authorGeorges Gonthier2019-05-21 16:50:17 +0200
committerGeorges Gonthier2019-05-23 18:38:48 +0200
commit7c82a2713c8827ebc1e2896c83c6e7bd2f81c063 (patch)
tree6119746e0f4f791a19be114bdfaa2f2ae67748a8 /parsing/pcoq.ml
parent6dadcffd83b034c177d1e8d2153b51e306138333 (diff)
do not parse `|` as infix in patterns; parse `|}` as `|` `}`
* use mixfix `(p1 | … | pn)` notation for nested disjunctive patterns, rather than infix `|`, making pattern syntax consistent with term syntax. * disable extending `pattern` grammar with notation incompatible with the nested disjunctive pattern syntax `(p1 | … | pn)`, such as the `(p | q)` divisibility notation used by `Numbers`. * emit a (disabled by default) `disj-pattern-notation` warning when such `Notation` is attempted. * update documentation accordingly; document incompatibilities in `changelog`. * comment special treatment of `(num)` in grammar. * update file extensions in `Pcoq` header comment. * correct the keyword declarations to reflect the contents of the grammar files; perhaps there should be an option to disable implicit keyword extension in a `.mlg` file, so that these lists could actually be checked. * parse the `|}` manifest record terminator as `|` followed by `}`, eliminating the `|}` token which conflicts with notations that use `|` as a terminator (such as, absolute value, norm, or cardinal in MathComp). Since `|` is now an `operconstr` _and_ `pattern` terminator, `bar_cbrace` rule checks for contiguous symbols, this change entails no visible behaviour change.
Diffstat (limited to 'parsing/pcoq.ml')
-rw-r--r--parsing/pcoq.ml2
1 files changed, 2 insertions, 0 deletions
diff --git a/parsing/pcoq.ml b/parsing/pcoq.ml
index a78ad4f842..b474c8e9a9 100644
--- a/parsing/pcoq.ml
+++ b/parsing/pcoq.ml
@@ -411,6 +411,8 @@ module Prim =
let ne_string = Entry.create "Prim.ne_string"
let ne_lstring = Entry.create "Prim.ne_lstring"
+ let bar_cbrace = Entry.create "'|}'"
+
end
module Constr =