Documentation

Regex.Syntax.Grammar.Basic

Parser utils for ReaderT and StateT

@[instance_reducible]
Equations
@[irreducible]
def Parser.loop {ρ σ α : Type} (f : 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.StateT.efoldlP {ε ι τ : Type u} {m : Type u → Type v} [Std.Iterator ι Id τ] {β α σ : Type u} [Std.Iterators.Finite ι Id] [Monad m] (f : β → α → StateT σ (ParseIt.ParserT ε ι τ m) β) (init : β) (p : StateT σ (ParseIt.ParserT ε ι τ m) α) :
    StateT σ (ParseIt.ParserT ε ι τ m) (β × Option ε)
    Equations
    Instances For
      @[irreducible]
      def Parser.StateT.efoldlP.loop {ε ι τ : Type u} {m : Type u → Type v} [Std.Iterator ι Id τ] {β α σ : Type u} [Monad m] (f : β → α → StateT σ (ParseIt.ParserT ε ι τ m) β) (p : StateT σ (ParseIt.ParserT ε ι τ m) α) [Std.Iterators.Finite ι Id] (s : σ) (it : Std.Iter τ) (y : β) (cur : Std.Iter τ) (hcur : ParseIt.Progress cur it) :
      m (ParseIt.Result ε it ((β × Option ε) × σ))

      Fold from iterator cur, which it progressed to, with accumulator y.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Parser.StateT.foldlP {ε ι τ : Type u} {m : Type u → Type v} [Std.Iterator ι Id τ] {β α σ : Type u} [Std.Iterators.Finite ι Id] [Monad m] (f : β → α → StateT σ (ParseIt.ParserT ε ι τ m) β) (init : β) (p : StateT σ (ParseIt.ParserT ε ι τ m) α) :
        StateT σ (ParseIt.ParserT ε ι τ m) β
        Equations
        Instances For
          def Parser.StateT.foldl {ε ι τ : Type u} {m : Type u → Type v} [Std.Iterator ι Id τ] {β α σ : Type u} [Std.Iterators.Finite ι Id] [Monad m] (f : β → α → β) (init : β) (p : StateT σ (ParseIt.ParserT ε ι τ m) α) :
          StateT σ (ParseIt.ParserT ε ι τ m) β
          Equations
          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 : Char → Bool) (f : Char → String.Pos.Raw → String.Pos.Raw → α) :
                                Equations
                                Instances For
                                  Equations
                                  Instances For
                                    Equations
                                    Instances For