Module schema_parser

Types

ColKind = enum
  StrCol, IntCol, FloatCol, DateCol
  Source Edit
Column = object
  name*: string
  case kind*: ColKind
  of StrCol:
      stripQuotes: bool

  of DateCol:
      format: string

  else:
      nil

  
  Source Edit

Procs

proc strCol(name: string): Column {.
raises: [], tags: []
.}
  Source Edit
proc intCol(name: string): Column {.
raises: [], tags: []
.}
  Source Edit
proc floatCol(name: string): Column {.
raises: [], tags: []
.}
  Source Edit
proc dateCol(name: string; format: string = "yyyy-MM-dd"): Column {.
raises: [], tags: []
.}
  Source Edit

Macros

macro schemaType[](schema: static[openArray[Column]]): untyped
Creates a type corresponding to a given schema (the return type of the generated schemaParser proc).   Source Edit
macro schemaParser[](schema: static[openArray[Column]]; sep: static[char]): untyped
Creates a schema parser proc, which takes a string as input and returns a the parsing result as a tuple, with types corresponding to the given schema   Source Edit

Templates

template skipPastSep(s: untyped; i: untyped; hitEnd: untyped; sep: char)
  Source Edit
template skipOverWhitespace(s: untyped; i: untyped)
  Source Edit