Documentation

Regex.Utils

Utils #

@[irreducible]
def Char.multiple (c : Char) (n : Nat) (acc : String) :

make String with n c chars

Equations
  • c.multiple n acc = if n = 0 then acc else c.multiple (n - 1) (c.toString ++ acc)
Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • val.intAsString = (↑val.val).intAsString
                Instances For
                  Equations

                  get i char in s, tood: switch to String.Pos logic

                  Equations
                  • s.getAtCodepoint i = if h : i < s.length then s.data.get i, h else default
                  Instances For

                    starts string m at codepoint i in s

                    Equations
                    • s.startsAtCodepoint m i = if i + m.length s.length then let s := s.toSubstring.drop i; s.toString.startsWith m else false
                    Instances For

                      compute the byte position of the codepoint position p in s

                      Equations
                      • s.toBytePosition p = { byteIdx := { data := List.take p s.data }.utf8ByteSize }
                      Instances For
                        def String.toSpan (s : String) (startPos : Nat) (stopPos : Nat) :

                        make Substring of String

                        Equations
                        • s.toSpan startPos stopPos = { str := s, startPos := s.toBytePosition startPos, stopPos := s.toBytePosition stopPos }
                        Instances For
                          Equations
                          Instances For
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For