compiler free of old expr/stmt metatypes

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

View file

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