sourcemap

Types

SourceNode = ref object
  line*: int
  column*: int
  source*: string
  name*: string
  children*: seq[Child]
  Source Edit
Child = ref object
  case kind*: C
  of cSourceNode:
      node*: SourceNode

  of cString:
      s*: string

  
  Source Edit
SourceMap = ref object
  version*: int
  sources*: seq[string]
  names*: seq[string]
  mappings*: string
  file*: string
  Source Edit
Mapping = ref object
  source*: string
  original*: tuple[line: int, column: int]
  generated*: tuple[line: int, column: int]
  name*: string
  noSource*: bool
  noName*: bool
  Source Edit

Procs

proc child(s: string): Child {...}{.raises: [], tags: [].}
  Source Edit
proc child(node: SourceNode): Child {...}{.raises: [], tags: [].}
  Source Edit
proc text(sourceNode: SourceNode; depth: int): string {...}{.raises: [ValueError],
    tags: [].}
  Source Edit
proc `$`(sourceNode: SourceNode): string {...}{.raises: [ValueError], tags: [].}
  Source Edit
proc encode(i: int): string {...}{.raises: [], tags: [].}
  Source Edit
proc parse(source: string; path: string): SourceNode {...}{.raises: [ValueError],
    tags: [].}
  Source Edit
proc index[T](elements: seq[T]; element: T): int
  Source Edit
proc gen(map: SourceMapGenerator): SourceMap {...}{.raises: [], tags: [].}
  Source Edit
proc addMapping(map: SourceMapGenerator; mapping: Mapping) {...}{.raises: [],
    tags: [].}
  Source Edit
proc walk(node: SourceNode; fn: proc (line: string; original: SourceNode)) {...}{.
    raises: [], tags: [].}
  Source Edit
proc toSourceMap(node: SourceNode; file: string): SourceMapGenerator {...}{.
    raises: [], tags: [].}
  Source Edit
proc genSourceMap(source: string; outFile: string): (Rope, SourceMap) {...}{.
    raises: [ValueError], tags: [].}
  Source Edit

Iterators

iterator tokenize(line: string): (bool, string) {...}{.raises: [], tags: [].}
  Source Edit