Equations
- Lean.Elab.Term.expandOptPrecedence stx = if Lean.Syntax.isNone stx = true then pure none else do let a ← Lean.evalPrec (Lean.Syntax.getOp (Lean.Syntax.getOp stx 0) 1) pure (some a)
- catName : Lean.Name
- first : Bool
- leftRec : Bool
- behavior : Lean.Parser.LeadingIdentBehavior
@[inline]
@[inline]
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.resolveParserName
{m : Type → Type}
[inst : Monad m]
[inst : Lean.Elab.MonadInfoTree m]
[inst : Lean.MonadResolveName m]
[inst : Lean.MonadEnv m]
[inst : Lean.MonadError m]
(parserName : Lean.Syntax)
:
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.
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.
partial def
Lean.Elab.Term.toParserDescr.processAlias
(id : Lean.Syntax)
(args : Array Lean.Syntax)
:
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 a s a_1 => 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.
def
Lean.Elab.Command.checkRuleKind
(given : Lean.SyntaxNodeKind)
(expected : Lean.SyntaxNodeKind)
:
def
Lean.Elab.Command.inferMacroRulesAltKind:
Lean.TSyntax `Lean.Parser.Term.matchAlt → Lean.Elab.Command.CommandElabM Lean.SyntaxNodeKind
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Command.expandNoKindMacroRulesAux
(alts : Array (Lean.TSyntax `Lean.Parser.Term.matchAlt))
(cmdName : String)
(mkCmd : Option Lean.Name → Array (Lean.TSyntax `Lean.Parser.Term.matchAlt) → Lean.Elab.Command.CommandElabM Lean.Command)
:
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