compiler/ropes

Source   Edit  

Types

FormatStr = string
Source   Edit  
Rope = ref RopeObj
Source   Edit  
RopeObj {.acyclic.} = object of RootObj
  left, right: Rope
  L: int
  data*: string
Source   Edit  

Procs

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

Iterators

iterator items(r: Rope): char {....raises: [], tags: [], forbids: [].}
iterates over any character in the rope r. Source   Edit  
iterator leaves(r: Rope): string {....raises: [], tags: [], forbids: [].}
iterates over any leaf string in the rope r. Source   Edit  

Templates

template addf(c: var Rope; frmt: FormatStr; args: openArray[Rope])
shortcut for add(c, frmt % args). Source   Edit  
template `~`(r: string): Rope
Source   Edit