chore: write "|-" as "|" noWs "-" (#2299)

* remove |- as an alias for ⊢

* revert false positive |->

* fix docstring

* undo previous changes

* [unchecked] use suggestion

* next attempt

* add test
This commit is contained in:
Floris van Doorn 2023-07-14 18:48:20 +02:00 committed by GitHub
parent 212cd9c3e6
commit 1a6663a41b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View file

@ -65,7 +65,7 @@ syntax unifConstraint := term patternIgnore(" =?= " <|> " ≟ ") term
syntax unifConstraintElem := colGe unifConstraint ", "?
syntax (docComment)? attrKind "unif_hint" (ppSpace ident)? (ppSpace bracketedBinder)*
" where " withPosition(unifConstraintElem*) patternIgnore("|-" <|> "⊢ ") unifConstraint : command
" where " withPosition(unifConstraintElem*) patternIgnore(atomic("|" noWs "-") <|> "⊢") unifConstraint : command
macro_rules
| `($[$doc?:docComment]? $kind:attrKind unif_hint $(n)? $bs* where $[$cs₁ ≟ $cs₂]* |- $t₁ ≟ $t₂) => do

View file

@ -304,7 +304,7 @@ syntax locationWildcard := " *"
A hypothesis location specification consists of 1 or more hypothesis references
and optionally `⊢` denoting the goal.
-/
syntax locationHyp := (ppSpace colGt term:max)+ ppSpace patternIgnore("⊢" <|> "|-")?
syntax locationHyp := (ppSpace colGt term:max)+ ppSpace patternIgnore( atomic("|" noWs "-") <|> "⊢")?
/--
Location specifications are used by many tactics that can operate on either the

7
tests/lean/run/2299.lean Normal file
View file

@ -0,0 +1,7 @@
class Abs (α : Type _) where
abs : αα
macro:max atomic("|" noWs) a:term noWs "|" : term => `(Abs.abs $a)
-- check that `|-` is not parsed as a single token.
example [Abs α] [Neg α] (n : α) : |-n| = |-n| := rfl