Documentation

Parser.RegEx.Basic

inductive Parser.RegEx :
Type u_1 → Type u_1

Type of regular expressions

Instances For
    def Parser.RegEx.depth {α : Type u_1} :
    RegEx αNat

    Grouping depth

    Equations
    Instances For
      def Parser.RegEx.fail {α : Type u_1} :

      Empty character set

      Equations
      Instances For
        def Parser.RegEx.any {α : Type u_1} :

        Universal character set

        Equations
        Instances For
          def Parser.RegEx.nil {α : Type u_1} :

          Nil expression

          Equations
          Instances For
            def Parser.RegEx.opt {α : Type u_1} (e : RegEx α) :

            Optional

            Equations
            Instances For
              def Parser.RegEx.rep {α : Type u_1} (n : Nat) (e : RegEx α) :

              Repetition

              Equations
              Instances For
                def Parser.RegEx.repMany1 {α : Type u_1} (e : RegEx α) :

                Unbounded repetition, at least once

                Equations
                Instances For
                  def Parser.RegEx.repManyN {α : Type u_1} (n : Nat) (e : RegEx α) :

                  Unbounded repetition, at least n times

                  Equations
                  Instances For
                    partial def Parser.RegEx.foldr {ε σ α β : Type (max u_1 u_2)} [Parser.Stream σ α] [Parser.Error ε σ α] {m : Type (max u_1 u_2) → Type u_3} [Monad m] (f : αββ) :
                    RegEx αParserT ε σ α m βParserT ε σ α m β

                    Fold over a regex match from the right

                    def Parser.RegEx.take {ε σ α : Type (max u_1 u_2)} [Parser.Stream σ α] [Parser.Error ε σ α] {m : Type (max u_1 u_2) → Type u_3} [Monad m] (re : RegEx α) :
                    ParserT ε σ α m (List α)

                    take re parses tokens matching regex re returning the list of tokens, otherwise fails

                    Equations
                    Instances For
                      def Parser.RegEx.drop {ε σ α : Type} [Parser.Stream σ α] [Parser.Error ε σ α] {m : TypeType u_1} [Monad m] (re : RegEx α) :
                      ParserT ε σ α m Unit

                      drop re parses tokens matching regex re, otherwise fails

                      Equations
                      Instances For
                        def Parser.RegEx.count {ε σ α : Type} [Parser.Stream σ α] [Parser.Error ε σ α] {m : TypeType u_1} [Monad m] (re : RegEx α) :
                        ParserT ε σ α m Nat

                        count re parses tokens matching regex re returning the number of tokens, otherwise fails

                        Equations
                        Instances For
                          def Parser.RegEx.match {ε σ α : Type (max u_1 u_2)} [Parser.Stream σ α] [Parser.Error ε σ α] {m : Type (max u_1 u_2) → Type u_3} [Monad m] (re : RegEx α) :
                          ParserT ε σ α m (Array (Option (Stream.Segment σ)))

                          Parses tokens matching regex re returning all the matching group segments, otherwise fails

                          Equations
                          Instances For
                            partial def Parser.RegEx.match.loop {ε σ α : Type (max u_1 u_2)} [Parser.Stream σ α] [Parser.Error ε σ α] {m : Type (max u_1 u_2) → Type u_3} [Monad m] :
                            RegEx αNatArray (Option (Stream.Segment σ))ParserT ε σ α m (Array (Option (Stream.Segment σ)))