platform.nim doesn't use globals anymore; prepare msgs.nim for not using globals
This commit is contained in:
parent
b2c7910fb6
commit
a4e2b0c153
35 changed files with 536 additions and 676 deletions
|
|
@ -217,11 +217,6 @@ proc ropeConcat*(a: varargs[Rope]): Rope =
|
|||
proc prepend*(a: var Rope, b: Rope) = a = b & a
|
||||
proc prepend*(a: var Rope, b: string) = a = b & a
|
||||
|
||||
var
|
||||
rnl* = tnl.newRope
|
||||
softRnl* = tnl.newRope
|
||||
noRnl* = "".newRope
|
||||
|
||||
proc `%`*(frmt: FormatStr, args: openArray[Rope]): Rope =
|
||||
var i = 0
|
||||
var length = len(frmt)
|
||||
|
|
@ -265,10 +260,10 @@ proc `%`*(frmt: FormatStr, args: openArray[Rope]): Rope =
|
|||
else:
|
||||
add(result, args[j-1])
|
||||
of 'n':
|
||||
add(result, softRnl)
|
||||
add(result, "\n")
|
||||
inc(i)
|
||||
of 'N':
|
||||
add(result, rnl)
|
||||
add(result, "\n")
|
||||
inc(i)
|
||||
else:
|
||||
doAssert false, "invalid format string: " & frmt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue