Documentation

ParseIt.Char.Basic

Character parsers #

Parsers for character tokens. These work with any iterator of Char, such as CharIterator. Character classes are ASCII only; Unicode classes are planned separately.

@[inline]
def ParseIt.Char.char {ε ι : Type} {m : Type → Type} [Std.Iterator ι Id Char] [Std.Iterators.Productive ι Id] [Error ε ι Char] [Monad m] (c : Char) :
ParserT ε ι Char m Char

char c accepts and returns character c.

Instances For
    def ParseIt.Char.string {ε ι : Type} {m : Type → Type} [Std.Iterator ι Id Char] [Std.Iterators.Productive ι Id] [Error ε ι Char] [Monad m] (s : String) :

    string s accepts the characters of s in order and returns s.

    Instances For
      @[inline]
      def ParseIt.Char.space {ε ι : Type} {m : Type → Type} [Std.Iterator ι Id Char] [Std.Iterators.Productive ι Id] [Error ε ι Char] [Monad m] :
      ParserT ε ι Char m Char

      Parse space (U+0020).

      Instances For
        @[inline]
        def ParseIt.Char.tab {ε ι : Type} {m : Type → Type} [Std.Iterator ι Id Char] [Std.Iterators.Productive ι Id] [Error ε ι Char] [Monad m] :
        ParserT ε ι Char m Char

        Parse horizontal tab (U+0009).

        Instances For
          @[inline]

          Parse line feed (U+000A).

          Instances For
            @[inline]

            Parse carriage return (U+000D).

            Instances For
              @[inline]
              def ParseIt.Char.eol {ε ι : Type} {m : Type → Type} [Std.Iterator ι Id Char] [Std.Iterators.Productive ι Id] [Error ε ι Char] [Monad m] :
              ParserT ε ι Char m Char

              Parse end of line: line feed, optionally preceded by carriage return.

              Instances For

                Parse whitespace character (space and U+0009 to U+000D).

                Instances For

                  Parse uppercase letter character (A to Z).

                  Instances For

                    Parse lowercase letter character (a to z).

                    Instances For

                      Parse alphabetic character (A to Z and a to z).

                      Instances For

                        Parse numeric character (0 to 9).

                        Instances For

                          Parse letter or digit character (A to Z, a to z and 0 to 9).

                          Instances For

                            Parse control character (U+0000 to U+001F and U+007F).

                            Instances For
                              def ParseIt.Char.ASCII.digit {ε ι : Type} {m : Type → Type} [Std.Iterator ι Id Char] [Std.Iterators.Productive ι Id] [Error ε ι Char] [Monad m] :
                              ParserT ε ι Char m (Fin 10)

                              Parse decimal digit (0 to 9).

                              Instances For

                                Parse binary digit (0 or 1).

                                Instances For

                                  Parse octal digit (0 to 7).

                                  Instances For
                                    def ParseIt.Char.ASCII.hexDigit {ε ι : Type} {m : Type → Type} [Std.Iterator ι Id Char] [Std.Iterators.Productive ι Id] [Error ε ι Char] [Monad m] :
                                    ParserT ε ι Char m (Fin 16)

                                    Parse hexadecimal digit (0 to 9, A to F and a to f).

                                    Instances For