compiler free of old expr/stmt metatypes

This commit is contained in:
Andreas Rumpf
2016-07-30 16:31:44 +02:00
parent 39ebe2175b
commit dfee2bf66e

View File

@@ -760,7 +760,7 @@ proc msgWriteln*(s: string, flags: MsgFlags = {}) =
flushFile(stderr)
macro callIgnoringStyle(theProc: typed, first: typed,
args: varargs[expr]): stmt =
args: varargs[typed]): untyped =
let typForegroundColor = bindSym"ForegroundColor".getType
let typBackgroundColor = bindSym"BackgroundColor".getType
let typStyle = bindSym"Style".getType
@@ -777,7 +777,7 @@ macro callIgnoringStyle(theProc: typed, first: typed,
typ != typTerminalCmd:
result.add(arg)
macro callStyledWriteLineStderr(args: varargs[expr]): stmt =
macro callStyledWriteLineStderr(args: varargs[typed]): untyped =
result = newCall(bindSym"styledWriteLine")
result.add(bindSym"stderr")
for arg in children(args[0][1]):
@@ -789,7 +789,7 @@ template callWritelnHook(args: varargs[string, `$`]) =
s.add arg
writelnHook s
template styledMsgWriteln*(args: varargs[expr]) =
template styledMsgWriteln*(args: varargs[typed]) =
if not isNil(writelnHook):
callIgnoringStyle(callWritelnHook, nil, args)
elif optStdout in gGlobalOptions:
@@ -1000,11 +1000,11 @@ proc internalError*(errMsg: string) =
writeContext(unknownLineInfo())
rawMessage(errInternal, errMsg)
template assertNotNil*(e: expr): expr =
template assertNotNil*(e): untyped =
if e == nil: internalError($instantiationInfo())
e
template internalAssert*(e: bool): stmt =
template internalAssert*(e: bool) =
if not e: internalError($instantiationInfo())
proc addSourceLine*(fileIdx: int32, line: string) =