Documentation

Lean.DocString.Parser

A parser that does nothing.

Equations
Instances For

    Parses as p, but discards the result.

    Equations
    Instances For
      def Lean.Doc.Parser.asStringFn (p : Parser.ParserFn) (quoted : Bool := false) (transform : StringString := id) :

      Match an arbitrary Parser and return the consumed String in a Syntax.atom.

      Equations
      Instances For

        Construct a “fake” atom with the given string content and source information.

        Normally, atoms are always substrings of the original input; however, Verso's concrete syntax is different enough from Lean's that this isn't always a good match.

        Equations
        Instances For

          Ordered lists may have two styles of indicator, with trailing dots or parentheses.

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

              Unordered lists may have three indicators: asterisks, dashes, or pluses.

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

                  Parses a character that's allowed as part of inline text. This resolves escaped characters and performs limited lookahead for characters that only begin a different inline as part of a sequence.

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

                    Parses block opener prefixes. At the beginning of the line, if this parser succeeds, then a special block is beginning.

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

                      Parses an argument value, which may be a string literal, identifier, or numeric literal.

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

                        Recovers from a parse error by skipping input until one or more complete blank lines has been skipped.

                        Equations
                        Instances For

                          Parses an argument to a role, directive, command, or code block, which may be named or positional or a flag.

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

                            Parses zero or more arguments to a role, directive, command, or code block.

                            Equations
                            Instances For

                              Parses a name and zero or more arguments to a role, directive, command, or code block.

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

                                The context within which a newline element is parsed.

                                • allowNewlines : Bool

                                  Are newlines allowed here?

                                • minIndent : Nat

                                  The minimum indentation of a continuation line for the current paragraph

                                • boldDepth : Option Nat

                                  How many asterisks introduced the current level of boldness? none means no bold here.

                                • emphDepth : Option Nat

                                  How many underscores introduced the current level of emphasis? none means no emphasis here.

                                Instances For
                                  Equations
                                  Instances For

                                    Parses emphasis: a matched pair of one or more _.

                                    Parses bold: a matched pair of one or more *.

                                    Parses inline code.

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

                                      Parses mathematics.

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

                                        Reads a prefix of a line of text, stopping at a text-mode special character.

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

                                          Parses a footnote.

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

                                            Parses an image.

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

                                              Parses a role.

                                              Parses an inline that is self-delimiting (that is, with well-defined start and stop characters).

                                              Parses any inline element.

                                              Records that the parser is presently parsing a list.

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

                                                  The context within which a block should be valid.

                                                  • minIndent : Nat

                                                    The block's minimum indentation.

                                                  • maxDirective : Option Nat

                                                    The block's maximal directive size (that is, the greatest number of allowed colons).

                                                  • inLists : List InList

                                                    The nested list context, innermost first.

                                                  • docStartPosition : Position

                                                    The position at which the document content starts, used to allow headers on the first line of a docstring (e.g. /-! # Header -/). With the default value ⟨1, 0⟩, the beginning-of-line check is unaffected for normal documents.

                                                  • baseColumn : Nat

                                                    The base column of the docstring, which is the least indentation of any non-empty line in it, including the opening and closing delimiters. For indented docstrings (e.g. inside where blocks), beginning-of-line checks use this column instead of requiring column 0. With the default value 0, the check is equivalent to column == 0.

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

                                                        Computes the BlockCtxt for parsing a docstring that starts at startPos in the given file map. endPos is the position of the - in the closing delimiter. When the docstring content starts mid-line (e.g. /-! # Header -/), the docStartPosition is set to the position after any leading spaces so that headers on the first line are recognized. For indented docstrings, baseColumn is computed as the minimum column among the opening delimiter, closing delimiter, and the least-indented non-empty content line.

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

                                                          Parses a metadata block, which contains the contents of a Lean structure initialization but is surrounded by %%% on each side.

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

                                                            Succeeds when the parser is looking at an ordered list indicator.

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

                                                              Succeeds when the parser is looking at an unordered list indicator.

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

                                                                Parses a list item according to the current nesting context.

                                                                Parses an item from a description list.

                                                                Parses a block quote.

                                                                Parses an unordered list.

                                                                Parses an ordered list.

                                                                Parses a definition list.

                                                                Parses a paragraph (that is, a sequence of otherwise-undecorated inlines).

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

                                                                  Parses a header.

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

                                                                    Parses a code block. The resulting string literal has already had the fences' leading indentation stripped.

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

                                                                      Parses a directive.

                                                                      Parses a block command.

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

                                                                        Parses a link reference target.

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

                                                                          Parses a footnote reference target.

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

                                                                            Parses a block.

                                                                            Parses zero or more blocks.

                                                                            Parses one or more blocks.

                                                                            Parses some number of blank lines followed by zero or more blocks.

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

                                                                              Parses as ifVerso if the option doc.verso is true, or as ifNotVerso otherwise.

                                                                              Equations
                                                                              Instances For

                                                                                Parses as ifVerso if the option doc.verso is true, or as ifNotVerso otherwise.

                                                                                Equations
                                                                                Instances For

                                                                                  Formatter for ifVerso—formats according to the underlying formatters.

                                                                                  Equations
                                                                                  Instances For

                                                                                    Parenthesizer for ifVerso—parenthesizes according to the underlying parenthesizers.

                                                                                    Equations
                                                                                    Instances For

                                                                                      Parses as ifVerso if module docs should use Verso syntax, or as ifNotVerso otherwise. Checks doc.verso.module if explicitly set, otherwise falls back to doc.verso.

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

                                                                                        Parses as ifVerso if module docs should use Verso syntax, or as ifNotVerso otherwise. Checks doc.verso.module if explicitly set, otherwise falls back to doc.verso.

                                                                                        Equations
                                                                                        Instances For

                                                                                          Formatter for ifVersoModuleDocs—formats according to the underlying formatters.

                                                                                          Equations
                                                                                          Instances For

                                                                                            Parenthesizer for ifVersoModuleDocs—parenthesizes according to the underlying parenthesizers.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Disables the option doc.verso while running a parser.

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

                                                                                                Parenthesizer for withoutVersoSyntax—parenthesizes according to the underlying parenthesizer.

                                                                                                Equations
                                                                                                Instances For