Added system.staticExec proc for executing external command at compile-time

This commit is contained in:
Zahary Karadjov 2012-06-02 19:51:49 +03:00
commit a1da1f987b
13 changed files with 83 additions and 39 deletions

View file

@ -27,7 +27,7 @@ proc semWhen(c: PContext, n: PNode, semCheck = true): PNode =
case it.kind
of nkElifBranch, nkElifExpr:
checkSonsLen(it, 2)
var e = semAndEvalConstExpr(c, it.sons[0])
var e = semConstExpr(c, it.sons[0])
if e.kind != nkIntLit: InternalError(n.info, "semWhen")
if e.intVal != 0 and result == nil:
setResult(it.sons[1])