src/hmisc/other/strparser

  Source   Edit

Simple string parsing algorithm for splitting things like [a, b] into ["a", "b"]. Not fully finished & usable, but there are unit tests in tHalgorithm.nim::Strparser

Procs

proc fmtArgs(str: string; until: string; default: seq[string] = @[]): tuple[
    args: seq[string], argl: int] {....raises: [], tags: [].}
  Source   Edit
proc parseTo(str: string; t: int): Option[int] {....raises: [], tags: [].}
  Source   Edit
proc parseTo(str: string; t: seq[string]): Option[seq[string]] {.
    ...raises: [RegexError], tags: [].}
  Source   Edit
proc parseTo(val: string; t: string): Option[string] {....raises: [], tags: [].}
  Source   Edit
proc toBool(str: string): bool {....raises: [], tags: [].}
  Source   Edit
proc toInt(str: string): int {....raises: [ValueError], tags: [].}
  Source   Edit
proc toIntSeq(str: string): seq[int] {....raises: [RegexError, ValueError],
                                       tags: [].}
  Source   Edit
proc toStr(str: string): string {....raises: [], tags: [].}
  Source   Edit
proc toStrSeq(str: string): seq[string] {....raises: [RegexError], tags: [].}
Parser string to sequence of strings   Source   Edit
proc toTuple[A](str: string): (A, A)
  Source   Edit
proc tupleSplit(str: string; delim: string): (string, string) {....raises: [],
    tags: [].}
  Source   Edit