Equations
- stx.prettyPrint = match stx.unsetTrailing.reprint with | some str => Std.format str.toFormat | none => Std.format stx
Equations
- One or more equations did not get rendered due to their size.
Two names are from the same lexical scope if their scoping information modulo MacroScopesView.name
is equal.
Equations
- One or more equations did not get rendered due to their size.
@[reducible, inline]
If ref
does not have position information, then try to use macroStack
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.addMacroStack
{m : Type → Type}
[Monad m]
[MonadOptions m]
(msgData : MessageData)
(macroStack : MacroStack)
:
Equations
- One or more equations did not get rendered due to their size.
- Lean.Elab.addMacroStack msgData [] = do let __do_lift ← Lean.getOptions if (!Lean.Option.get __do_lift Lean.Elab.pp.macroStack) = true then pure msgData else pure msgData
def
Lean.Elab.checkSyntaxNodeKind
{m : Type → Type}
[Monad m]
[MonadEnv m]
[MonadError m]
(k : Name)
:
m Name
Equations
- Lean.Elab.checkSyntaxNodeKind k = do let __do_lift ← Lean.getEnv if Lean.Parser.isValidSyntaxNodeKind __do_lift k = true then pure k else Lean.throwError (Lean.toMessageData "failed")
def
Lean.Elab.checkSyntaxNodeKindAtNamespaces
{m : Type → Type}
[Monad m]
[MonadEnv m]
[MonadError m]
(k : Name)
:
Equations
- Lean.Elab.checkSyntaxNodeKindAtNamespaces k (p.str str) = (Lean.Elab.checkSyntaxNodeKind (p.str str ++ k) <|> Lean.Elab.checkSyntaxNodeKindAtNamespaces k p)
- Lean.Elab.checkSyntaxNodeKindAtNamespaces k Lean.Name.anonymous = Lean.Elab.checkSyntaxNodeKind k
- Lean.Elab.checkSyntaxNodeKindAtNamespaces k x✝ = Lean.throwError (Lean.toMessageData "failed")
Equations
- Lean.Elab.checkSyntaxNodeKindAtCurrentNamespaces k = do let ctx ← read Lean.Elab.checkSyntaxNodeKindAtNamespaces k ctx.currNamespace
Equations
- One or more equations did not get rendered due to their size.
@[implemented_by _private.Lean.Elab.Util.0.Lean.Elab.evalSyntaxConstantUnsafe]
unsafe def
Lean.Elab.mkElabAttribute
(γ : Type)
(attrBuiltinName attrName parserNamespace typeName : Name)
(kind : String)
(attrDeclName : Name := by exact decl_name%)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.mkMacroAttributeUnsafe ref = Lean.Elab.mkElabAttribute Lean.Macro `builtin_macro `macro Lean.Name.anonymous `Lean.Macro "macro" ref
@[implemented_by Lean.Elab.mkMacroAttributeUnsafe]
Try to expand macro at syntax tree root and return macro declaration name and new syntax if successful.
Return none if all macros threw Macro.Exception.unsupportedSyntax
.
Equations
- One or more equations did not get rendered due to their size.
- getCurrMacroScope : m MacroScope
- getNextMacroScope : m MacroScope
- setNextMacroScope : MacroScope → m Unit
@[always_inline]
instance
Lean.Elab.instMonadMacroAdapterOfMonadLift
(m n : Type → Type)
[MonadLift m n]
[MonadMacroAdapter m]
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.liftMacroM
{m : Type → Type}
{α : Type}
[Monad m]
[MonadMacroAdapter m]
[MonadEnv m]
[MonadRecDepth m]
[MonadError m]
[MonadResolveName m]
[MonadTrace m]
[MonadOptions m]
[AddMessageContext m]
[MonadLiftT IO m]
(x : MacroM α)
:
m α
Equations
- One or more equations did not get rendered due to their size.
@[inline]
def
Lean.Elab.adaptMacro
{m : Type → Type}
[Monad m]
[MonadMacroAdapter m]
[MonadEnv m]
[MonadRecDepth m]
[MonadError m]
[MonadResolveName m]
[MonadTrace m]
[MonadOptions m]
[AddMessageContext m]
[MonadLiftT IO m]
(x : Macro)
(stx : Syntax)
:
m Syntax
Equations
- Lean.Elab.adaptMacro x stx = Lean.Elab.liftMacroM (x stx)
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.logException
{m : Type → Type}
[Monad m]
[MonadLog m]
[AddMessageContext m]
[MonadOptions m]
[MonadLiftT IO m]
(ex : Exception)
:
m Unit
Equations
- One or more equations did not get rendered due to their size.
- Lean.Elab.logException (Lean.Exception.error ref msg) = Lean.logErrorAt ref msg
def
Lean.Elab.withLogging
{m : Type → Type}
[Monad m]
[MonadLog m]
[MonadExcept Exception m]
[AddMessageContext m]
[MonadOptions m]
[MonadLiftT IO m]
(x : m Unit)
:
m Unit
If x
throws an exception, catch it and turn it into a log message (using logException
).
Equations
- Lean.Elab.withLogging x = tryCatch x fun (ex : Lean.Exception) => Lean.Elab.logException ex
def
Lean.Elab.throwErrorWithNestedErrors
{m : Type → Type}
{α : Type}
[MonadError m]
[Monad m]
[MonadLog m]
(msg : MessageData)
(exs : Array Exception)
:
m α
Equations
- One or more equations did not get rendered due to their size.