compiler/utils/ropes

  Source   Edit

An implemention of ropes for use by the C and JS code generators was previously located here, but now Rope is only an alias for string.

Types

FormatStr = string
  Source   Edit
Rope = string
  Source   Edit

Procs

proc `%`(frmt: static[FormatStr]; args: openArray[Rope]): Rope
  Source   Edit
proc `&`(a: openArray[Rope]): Rope {....raises: [], tags: [].}
the concatenation operator for an openarray of ropes.   Source   Edit
proc equalsFile(r: Rope; filename: AbsoluteFile): bool {....raises: [IOError],
    tags: [ReadIOEffect].}
returns true if the contents of the file f equal r. If f does not exist, false is returned.   Source   Edit
proc equalsFile(s: Rope; f: File): bool {....raises: [IOError],
    tags: [ReadIOEffect].}
returns true if the contents of the file f equal r.   Source   Edit
func prepend(a: var Rope; b: string) {....raises: [], tags: [].}
  Source   Edit
proc rope(f: BiggestFloat): Rope {....raises: [], tags: [].}
Converts a float to a rope.   Source   Edit
proc rope(i: BiggestInt): Rope {....raises: [], tags: [].}
Converts an int to a rope.   Source   Edit
proc ropeConcat(a: varargs[Rope]): Rope {....raises: [], tags: [].}
  Source   Edit
proc runtimeFormat(frmt: FormatStr; args: openArray[Rope]): Rope {....raises: [],
    tags: [].}
  Source   Edit
proc writeRope(f: File; r: Rope) {....raises: [IOError], tags: [WriteIOEffect].}
writes a rope to a file.   Source   Edit
proc writeRope(head: Rope; filename: AbsoluteFile): bool {....raises: [IOError],
    tags: [WriteIOEffect].}
  Source   Edit
proc writeRopeIfNotEqual(r: Rope; filename: AbsoluteFile): bool {.
    ...raises: [IOError], tags: [ReadIOEffect, WriteIOEffect].}
  Source   Edit

Templates

template `~`(r: string): Rope
  Source   Edit
template addf(c: var Rope; frmt: FormatStr; args: openArray[Rope])
shortcut for add(c, frmt % args).   Source   Edit
template rope(s: string): Rope
A no-op -- the same as using s directly   Source   Edit