Documentation

Lean.Parser.Extension

Extensible parsing via attributes

Equations
@[reducible, inline]
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
        Equations
        Instances For
          Equations
          Instances For
            inductive Lean.Parser.AliasValue (α : Type) :

            Parser aliases for making ParserDescr extensible

            Instances For
              @[reducible, inline]
              Equations
              Instances For
                Instances For
                  Equations
                  Instances For
                    def Lean.Parser.getConstAlias {α : Type} (mapRef : IO.Ref (Lean.Parser.AliasTable α)) (aliasName : Lean.Name) :
                    IO α
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Lean.Parser.getUnaryAlias {α : Type} (mapRef : IO.Ref (Lean.Parser.AliasTable α)) (aliasName : Lean.Name) :
                      IO (αα)
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Lean.Parser.getBinaryAlias {α : Type} (mapRef : IO.Ref (Lean.Parser.AliasTable α)) (aliasName : Lean.Name) :
                        IO (ααα)
                        Instances For
                          @[reducible, inline]
                          Instances For
                            • declName : Lean.Name
                            • stackSz? : Option Nat

                              Number of syntax nodes produced by this parser. none means "sum of input sizes".

                            • autoGroupArgs : Bool

                              Whether arguments should be wrapped in group(·) if they do not produce exactly one syntax node.

                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Lean.Parser.registerAlias (aliasName declName : Lean.Name) (p : Lean.Parser.ParserAliasValue) (kind? : Option Lean.SyntaxNodeKind := none) (info : Lean.Parser.ParserAliasInfo := { declName := Lean.Name.anonymous, stackSz? := some 1, autoGroupArgs := (some 1).isSome }) :
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Equations
                                  Instances For
                                    @[implemented_by Lean.Parser.mkParserOfConstantUnsafe]
                                    Instances For
                                      def Lean.Parser.runParserAttributeHooks (catName declName : Lean.Name) (builtin : Bool) :
                                      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
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            @[implemented_by Lean.Parser.evalParserConstUnsafe]

                                            Run declName if possible and inside a quotation, or else p. The ParserInfo will always be taken from p.

                                            Instances For
                                              def Lean.Parser.addBuiltinParser (catName declName : Lean.Name) (leading : Bool) (p : Lean.Parser.Parser) (prio : Nat) :
                                              Instances For
                                                Instances For
                                                  Equations
                                                  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
                                                        def Lean.Parser.mkInputContext (input fileName : String) (normalizeLineEndings : Bool := true) :
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          def Lean.Parser.runParserCategory (env : Lean.Environment) (catName : Lean.Name) (input : String) (fileName : String := "<input>") :

                                                          convenience function for testing

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            def Lean.Parser.declareBuiltinParser (addFnName catName declName : Lean.Name) (prio : Nat) :
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              Instances For
                                                                Instances For
                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For

                                                                    The parsing tables for builtin parsers are "stored" in the extracted source code.

                                                                    Instances For
                                                                      def Lean.Parser.mkParserAttributeImpl (attrName catName : Lean.Name) (ref : Lean.Name := by exact decl_name%) :
                                                                      Instances For
                                                                        def Lean.Parser.registerBuiltinDynamicParserAttribute (attrName catName : Lean.Name) (ref : Lean.Name := by exact decl_name%) :

                                                                        A builtin parser attribute that can be extended by users.

                                                                        Equations
                                                                        Instances For
                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            @[inline]
                                                                            Equations
                                                                            Instances For
                                                                              Equations
                                                                              • One or more equations did not get rendered due to their size.
                                                                              Instances For

                                                                                If the parsing stack is of the form #[.., openCommand], we process the open command, and execute p

                                                                                Instances For

                                                                                  If the parsing stack is of the form #[.., openDecl], we process the open declaration, and execute p

                                                                                  Instances For

                                                                                    Helper environment extension that gives us access to built-in aliases in pure parser functions.

                                                                                    Result of resolving a parser name.

                                                                                    Instances For

                                                                                      Resolve the given parser name and return a list of candidates.

                                                                                      Equations
                                                                                      Instances For
                                                                                        Equations
                                                                                        • One or more equations did not get rendered due to their size.
                                                                                        Instances For

                                                                                          Resolve the given parser name and return a list of candidates.

                                                                                          Equations
                                                                                          Instances For

                                                                                            Resolve the given parser name and return a list of candidates.

                                                                                            Instances For
                                                                                              Equations
                                                                                              • One or more equations did not get rendered due to their size.
                                                                                              Instances For
                                                                                                def Lean.Parser.parserOfStack (offset : Nat) (prec : Nat := 0) :
                                                                                                Equations
                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                Instances For