Documentation

Regex.Syntax.Grammar.Basic

Parser utils for ReaderT and StateT

@[reducible, inline]
Equations
Instances For
    @[implicit_reducible]
    Equations
    def Parser.attemptM {ρ σ α : Type} (p : ReaderT ρ (StateT σ SimpleCharParser) α) :

    extends Lean.Parser.attempt

    Equations
    Instances For

      Returns a natural number measure of remaining input. see https://github.com/fgdorais/lean4-parser/pull/99

      • remaining : σNat
      Instances
        @[irreducible]
        def Parser.loop {ρ σ α : Type} (p : ReaderT ρ (StateT σ SimpleCharParser) αReaderT ρ (StateT σ SimpleCharParser) α) :

        The recursive function loop calls p with a parser that acts like p except it fails if called from the same or lower string position

        see https://leanprover.zulipchat.com/#narrow/channel/113488-general/topic/Advent.20of.20Code.3F/near/405471085

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Parser.manyM {ρ σ α : Type} (p : ReaderT ρ (StateT σ SimpleCharParser) α) :
          Equations
          Instances For
            Equations
            Instances For
              Equations
              Instances For
                Equations
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    exec check on current char

                    Equations
                    Instances For

                      exec check on current char and consume char on success

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

                        exec check on current char and skip char on success

                        Equations
                        Instances For

                          exec check on current char and then exec p on success

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

                            exec check on current char and then exec p on success

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Parser.tryCharWithPosMap {α : Type} (check : CharBool) (f : CharString.Pos.RawString.Pos.Rawα) :
                              Equations
                              Instances For
                                Equations
                                Instances For