chore: update stage0
This commit is contained in:
parent
257e38394f
commit
9988264345
2 changed files with 1709 additions and 254 deletions
8
stage0/src/Lean/Parser/Term.lean
generated
8
stage0/src/Lean/Parser/Term.lean
generated
|
|
@ -93,9 +93,12 @@ def binderTactic := leading_parser atomic (symbol " := " >> " by ") >> Tactic.t
|
|||
def binderDefault := leading_parser " := " >> termParser
|
||||
def explicitBinder (requireType := false) := ppGroup $ leading_parser "(" >> many1 binderIdent >> binderType requireType >> optional (binderTactic <|> binderDefault) >> ")"
|
||||
def implicitBinder (requireType := false) := ppGroup $ leading_parser "{" >> many1 binderIdent >> binderType requireType >> "}"
|
||||
def strictImplicitLeftBracket := atomic (group (symbol "{" >> "{")) <|> "⦃"
|
||||
def strictImplicitRightBracket := atomic (group (symbol "}" >> "}")) <|> "⦄"
|
||||
def strictImplicitBinder (requireType := false) := ppGroup $ leading_parser strictImplicitLeftBracket >> many1 binderIdent >> binderType requireType >> strictImplicitRightBracket
|
||||
def instBinder := ppGroup $ leading_parser "[" >> optIdent >> termParser >> "]"
|
||||
def bracketedBinder (requireType := false) := withAntiquot (mkAntiquot "bracketedBinder" none (anonymous := false)) <|
|
||||
explicitBinder requireType <|> implicitBinder requireType <|> instBinder
|
||||
explicitBinder requireType <|> strictImplicitBinder requireType <|> implicitBinder requireType <|> instBinder
|
||||
|
||||
/-
|
||||
It is feasible to support dependent arrows such as `{α} → α → α` without sacrificing the quality of the error messages for the longer case.
|
||||
|
|
@ -139,8 +142,9 @@ def generalizingParam := leading_parser atomic ("(" >> nonReservedSymbol "genera
|
|||
@[builtinTermParser] def «nomatch» := leading_parser:leadPrec "nomatch " >> termParser
|
||||
|
||||
def funImplicitBinder := atomic (lookahead ("{" >> many1 binderIdent >> (symbol " : " <|> "}"))) >> implicitBinder
|
||||
def funStrictImplicitBinder := atomic (lookahead (strictImplicitLeftBracket >> many1 binderIdent >> (symbol " : " <|> strictImplicitRightBracket))) >> strictImplicitBinder
|
||||
def funSimpleBinder := atomic (lookahead (many1 binderIdent >> " : ")) >> simpleBinder
|
||||
def funBinder : Parser := funImplicitBinder <|> instBinder <|> funSimpleBinder <|> termParser maxPrec
|
||||
def funBinder : Parser := funStrictImplicitBinder <|> funImplicitBinder <|> instBinder <|> funSimpleBinder <|> termParser maxPrec
|
||||
-- NOTE: we use `nodeWithAntiquot` to ensure that `fun $b => ...` remains a `term` antiquotation
|
||||
def basicFun : Parser := nodeWithAntiquot "basicFun" `Lean.Parser.Term.basicFun (many1 (ppSpace >> funBinder) >> darrow >> termParser)
|
||||
@[builtinTermParser] def «fun» := leading_parser:maxPrec unicodeSymbol "λ" "fun" >> (basicFun <|> matchAlts)
|
||||
|
|
|
|||
1955
stage0/stdlib/Lean/Parser/Term.c
generated
1955
stage0/stdlib/Lean/Parser/Term.c
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue