system.nim: fix doc comment for 'once'

This commit is contained in:
Andreas Rumpf 2018-09-05 18:05:55 +02:00 • committed by Araq
commit b5730ec01f

View file

@ -4127,13 +4127,13 @@ template once*(body: untyped): untyped =
## re-executed on each module reload. ## re-executed on each module reload.
## ##
## .. code-block:: nim ## .. code-block:: nim
## proc draw(t: Triangle) =
## once:
## graphicsInit()
## ##
## line(t.p1, t.p2) ## proc draw(t: Triangle) =
## line(t.p2, t.p3) ## once:
## line(t.p3, t.p1) ## graphicsInit()
## line(t.p1, t.p2)
## line(t.p2, t.p3)
## line(t.p3, t.p1)
## ##
var alreadyExecuted {.global.} = false var alreadyExecuted {.global.} = false
if not alreadyExecuted: if not alreadyExecuted: