Skip to content

Commit

Permalink
doc: mention x:h@e variant in docstring of x@e (leanprover#3073)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser authored Dec 14, 2023
1 parent d279a48 commit 430f4d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/Lean/Elab/PatternVar.lean
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ partial def collect (stx : Syntax) : M Syntax := withRef stx <| withFreshMacroSc
```
def namedPattern := check... >> trailing_parser "@" >> optional (atomic (ident >> ":")) >> termParser
```
TODO: pattern variable for equality proof
-/
let id := stx[0]
discard <| processVar id
Expand Down
3 changes: 2 additions & 1 deletion src/Lean/Parser/Term.lean
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ def isIdent (stx : Syntax) : Bool :=
checkStackTop isIdent "expected preceding identifier" >>
checkNoWsBefore "no space before '.{'" >> ".{" >>
sepBy1 levelParser ", " >> "}"
/-- `x@e` matches the pattern `e` and binds its value to the identifier `x`. -/
/-- `x@e` or `x:h@e` matches the pattern `e` and binds its value to the identifier `x`.
If present, the identifier `h` is bound to a proof of `x = e`. -/
@[builtin_term_parser] def namedPattern : TrailingParser := trailing_parser
checkStackTop isIdent "expected preceding identifier" >>
checkNoWsBefore "no space before '@'" >> "@" >>
Expand Down

0 comments on commit 430f4d2

Please sign in to comment.