fix ropes format errors (#16106) [backport:1.0]
* fix rope index * add testcase * fix ropes format
This commit is contained in:
parent
7fc0c3dfbf
commit
0c6c4be0e7
2 changed files with 8 additions and 1 deletions
|
|
@ -262,7 +262,7 @@ proc `%`*(frmt: string, 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
|
||||
add(result, args[j-1])
|
||||
of '{':
|
||||
inc(i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue