diff options
author | koranza <stflynn@hotmail.com> | 2018-05-18 16:20:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-18 16:20:13 -0500 |
commit | 39988eb1cfae043271376bd21fa301ba2115b59c (patch) | |
tree | 661b2410afde62935766ccdf1f1803a1e8e7715f /compiler/ropes.nim | |
parent | b75008292506d49f2641550457354267e11e1116 (diff) | |
parent | 06bdf8392bd3e597dbe3ef12c7a819b60e32d7ac (diff) | |
download | Nim-39988eb1cfae043271376bd21fa301ba2115b59c.tar.gz |
Merge pull request #1 from nim-lang/devel
updating my fork with the head repo
Diffstat (limited to 'compiler/ropes.nim')
-rw-r--r-- | compiler/ropes.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/ropes.nim b/compiler/ropes.nim index 358ce8a53..05d5e840c 100644 --- a/compiler/ropes.nim +++ b/compiler/ropes.nim @@ -188,11 +188,11 @@ iterator leaves*(r: Rope): string = var stack = @[r] while stack.len > 0: var it = stack.pop - while isNil(it.data): + while it.left != nil: + assert it.right != nil stack.add(it.right) it = it.left assert(it != nil) - assert(it.data != nil) yield it.data iterator items*(r: Rope): char = @@ -251,7 +251,7 @@ proc `%`*(frmt: FormatStr, args: openArray[Rope]): Rope = while true: j = j * 10 + ord(frmt[i]) - ord('0') inc(i) - if frmt[i] notin {'0'..'9'}: break + if i >= frmt.len or frmt[i] notin {'0'..'9'}: break num = j if j > high(args) + 1: errorHandler(rInvalidFormatStr, $(j)) |