Documentation

Lean.Elab.Util

Instances For
    Instances For

      Two names are from the same lexical scope if their scoping information modulo MacroScopesView.name is equal.

      Instances For
        Instances For
          @[reducible, inline]
          Instances For
            def Lean.Elab.getBetterRef (ref : Syntax) (macroStack : MacroStack) :

            If ref does not have position information, then try to use macroStack

            Instances For
              def Lean.Elab.addMacroStack {m : TypeType} [Monad m] [MonadOptions m] (msgData : MessageData) (macroStack : MacroStack) :
              Instances For
                Instances For
                  Instances For
                    def Lean.Elab.syntaxNodeKindOfAttrParam (defaultParserNamespace : Name) (stx : Syntax) :
                    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%) :
                      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.SyntaxLean.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.

                        Instances For
                          Instances
                            Instances For

                              If x throws an exception, catch it and turn it into a log message (using logException).

                              Instances For
                                def Lean.Elab.throwErrorWithNestedErrors {m : TypeType} {α : Type} [MonadError m] [Monad m] [MonadLog m] (msg : MessageData) (exs : Array Exception) :
                                m α
                                Instances For