lots of small changes

This commit is contained in:
Arne Döring 2018-12-05 19:03:01 +01:00 • committed by Araq
commit a5ecbf823f
85 changed files with 180 additions and 110 deletions

View file

@ -252,7 +252,7 @@ template forwardPacketT*(typeName: expr): stmt {.dirty, immediate.} =
proc `pack typeName`*(p: var typeName; s: PStream) =
writeData(s, addr p, sizeof(p))
when isMainModule:
when true:
type
SomeEnum = enum
A = 0'i8,

View file

@ -244,7 +244,7 @@ template forwardPacketT*(typeName: untyped; underlyingType: untyped) {.dirty.} =
#writeData(s, addr p, sizeof(p))
buffer.write(underlyingType(ord))
when isMainModule:
when true:
type
SomeEnum = enum
A = 0'i8,

View file

@ -50,7 +50,7 @@ macro `?`(a: untyped): untyped =
result = ($a[1].ident)[0].lit
## echo(?F,?a,?t,?t,?y)
when isMainModule:
when true:
macro foo(x: untyped) =
result = newNimNode(nnkStmtList)
result.add(newNimNode(nnkCall).und(!!"echo", "Hello thar".lit))

View file

@ -24,7 +24,7 @@ proc writeLEStr*(s: PStream, str: string) =
s.write(str.len.int16)
s.write(str)
when isMainModule:
when true:
var testStream = newStringStream()
testStream.writeLEStr("Hello")

View file

@ -50,7 +50,7 @@ template withDir*(dir: string; body: stmt): stmt =
body
cd(curDir)
when isMainModule:
when true:
if not existsFile("nakefile.nim"):
echo "No nakefile.nim found. Current working dir is ", getCurrentDir()
quit 1