src/regex/common

Types

RegexError = object of ValueError
SortedSeq[T] = object
  s: seq[T]

Consts

invalidRune = -1'i32
lineBreakRune = 10'i32

Procs

proc `%%`(formatstr: string; a: openArray[string]): string {.noSideEffect,
    ...raises: [], tags: [].}
same as "$#" % ["foo"] but returns empty string on error
proc `%%`(formatstr: string; a: string): string {....raises: [], tags: [].}
func `<=`(x, y: Rune): bool {....raises: [], tags: [].}
func add[T](s: var SortedSeq[T]; x: openArray[T])
func bwRuneAt(s: openArray[char]; n: int): Rune {....raises: [], tags: [].}
Take rune ending at n
func cmp(x, y: Rune): int {....raises: [], tags: [].}
func contains[T](s: SortedSeq[T]; x: T): bool
func initSortedSeq[T](): SortedSeq[T] {.inline.}
func len[T](s: SortedSeq[T]): int {.inline.}
proc runeAt(s: openArray[char]; i: Natural): Rune {....raises: [], tags: [].}
func toRune(c: char): Rune {....raises: [], tags: [].}
func verifyUtf8(s: openArray[char]): int {....raises: [], tags: [].}
Return -1 if s is a valid utf-8 string. Otherwise, return the index of the first bad char.

Iterators

iterator items[T](s: SortedSeq[T]): T {.inline.}

Templates

template bwFastRuneAt(s: openArray[char]; n: var int; result: var Rune): untyped
Take rune ending at n
template fastRuneAt(s: openArray[char]; i: int; result: untyped; doInc = true)

Returns the rune s[i] in result.

If doInc == true (default), i is incremented by the number of bytes that have been processed.