Skip to content

Commit

Permalink
feat: helper parser for issue #1371
Browse files Browse the repository at this point in the history
  • Loading branch information
leodemoura committed Jul 31, 2022
1 parent cc03244 commit 2f00d60
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Lean/Parser/Term.lean
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ def matchAltsWhereDecls := leading_parser matchAlts >> optional whereDecls

@[builtinTermParser] def defaultOrOfNonempty := leading_parser "default_or_ofNonempty% " >> optional "unsafe"

/--
Helper parser for marking `match`-alternatives that should not trigger errors if unused.
We use them to implement `macro_rules` and `elab_rules`
-/
@[builtinTermParser] def noErrorIfUnused := leading_parser "no_error_if_unused%" >> termParser

def namedArgument := leading_parser (withAnonymousAntiquot := false) atomic ("(" >> ident >> " := ") >> termParser >> ")"
def ellipsis := leading_parser (withAnonymousAntiquot := false) ".."
def argument :=
Expand Down

0 comments on commit 2f00d60

Please sign in to comment.