Expand optional «precedence» where
«precedence» := leading_parser " : " >> precedenceParser
Equations
- Lean.Elab.Term.expandOptPrecedence stx = if Lean.Syntax.isNone stx = true then pure none else do let a ← Lean.evalPrec stx[0][1] pure (some a)
- catName : Lean.Name
- first : Bool
- leftRec : Bool
See comment at
Parser.ParserCategory.behavior : Lean.Parser.LeadingIdentBehavior
Instances For
(Try to) add a term info for the category catName at ref.
Equations
- One or more equations did not get rendered due to their size.
(Try to) add a term info for the alias with info info at ref.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Resolve the given parser name and return a list of candidates.
Each candidate is a pair (resolvedParserName, isDescr).
isDescr == true if the type of resolvedParserName is a ParserDescr.
Equations
- One or more equations did not get rendered due to their size.
Given a stx of category syntax, return a (newStx, lhsPrec?),
where newStx is of category term. After elaboration, newStx should have type
TrailingParserDescr if lhsPrec?.isSome, and ParserDescr otherwise.
Equations
- One or more equations did not get rendered due to their size.
Sequence (aka NullNode)
Equations
- Lean.Elab.Term.toParserDescr.ensureNoPrec stx = if Lean.Syntax.isNone stx[1] = true then pure PUnit.unit else Lean.throwErrorAt stx[1] (Lean.toMessageData "unexpected precedence")
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Auxiliary function for creating declaration names from parser descriptions. Example: Given
syntax term "+" term : term
syntax "[" sepBy(term, ", ") "]" : term
It generates the names term_+_ and term[_,]
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Command.mkNameFromParserSyntax.appendCatName catName str = match catName with | Lean.Name.str pre s => s ++ str | x => str
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Command.checkRuleKind given expected = (given == expected || given == expected ++ Lean.Name.mkStr1 "antiquot")
Equations
- One or more equations did not get rendered due to their size.
Infer syntax kind k from first pattern, put alternatives of same kind into new macro/elab_rules (kind := k) via mkCmd (some k),
leave remaining alternatives (via mkCmd none) to be recursively expanded.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Command.strLitToPattern stx = match Lean.Syntax.isStrLit? stx with | some str => pure (Lean.mkAtomFrom stx str) | none => Lean.Macro.throwUnsupported