Equations
- stx.prettyPrint = match stx.unsetTrailing.reprint with | some str => Std.format str.toFormat | none => Std.format stx
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[reducible, inline]
Instances For
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.
Instances For
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
Instances For
def
Lean.Elab.checkSyntaxNodeKind
{m : Type → Type}
[Monad m]
[MonadEnv m]
[MonadError m]
(k : Name)
:
m Name
Equations
- One or more equations did not get rendered due to their size.
Instances For
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")
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[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.
Instances For
Equations
- Lean.Elab.mkMacroAttributeUnsafe ref = Lean.Elab.mkElabAttribute Lean.Macro `builtin_macro `macro Lean.Name.anonymous `Lean.Macro "macro" ref
Instances For
@[implemented_by Lean.Elab.mkMacroAttributeUnsafe]
Registers a macro expander for a given syntax node kind.
A macro expander should have type Lean.Macro
(which is Lean.Syntax → Lean.MacroM Lean.Syntax
),
i.e. should take syntax of the given syntax node kind as a parameter and produce different syntax
in the same syntax category.
The macro_rules
and macro
commands should usually be preferred over using this attribute
directly.
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.
Instances For
- getContext : m Name
- getNextMacroScope : m MacroScope
- setNextMacroScope : MacroScope → m Unit
Instances
@[always_inline]
instance
Lean.Elab.instMonadMacroAdapterOfMonadLiftOfMonadQuotation
(m n : Type → Type)
[MonadLift m n]
[MonadQuotation 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.
Instances For
@[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)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
Instances For
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
Instances For
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.