diff options
author | Zahary Karadjov <zahary@gmail.comy> | 2011-10-06 03:55:02 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.comy> | 2011-10-07 17:10:04 +0300 |
commit | e3deb5b502888fce847ef21b86bbfc7e91c7dea4 (patch) | |
tree | 9c62ac1e02cc9cc14871ecb15855e339e51a5100 /lib/pure | |
parent | 22546c44d1a8c34077c7c24e0b565bc8900061d1 (diff) | |
download | Nim-e3deb5b502888fce847ef21b86bbfc7e91c7dea4.tar.gz |
Cleaned up the circular dependecies and remaining issues
Changed: The []= operator for strings and sequences is now capable of splicing
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/unittest.nim | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index a5c97ee9b..2322ffd69 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -56,7 +56,7 @@ template test*(name: expr, body: stmt): stmt = finally: TestTeardownIMPL() - echo "[" & $TestStatusIMPL & "] " & name + echo "[" & $TestStatusIMPL & "] " & name & "\n" proc checkpoint*(msg: string) = checkpoints.add(msg) @@ -77,19 +77,8 @@ macro check*(conditions: stmt): stmt = if not Exp: checkpoint(lineInfoLit & ": Check failed: " & expLit) fail() - - # XXX: If we don't create a string literal node below, the compiler - # will SEGFAULT in a rather strange fashion: - # - # rewrite(e, e.toStrLit, e.toStrLit) is ok, but - # - # rewrite(e, e.lineinfo, e.toStrLit) or - # rewrite(e, "anything", e.toStrLit) are not - # - # It may have something to do with the dummyContext hack in - # evals.nim/evalTemplate - # - result = getAst(rewrite(e, newStrLitNode(e.lineinfo), e.toStrLit)) + + result = getAst(rewrite(e, e.lineinfo, e.toStrLit)) case conditions.kind of nnkCall, nnkCommand, nnkMacroStmt: @@ -110,7 +99,7 @@ macro check*(conditions: stmt): stmt = result = getAst(rewrite( op[0], op[1], op[2], - newStrLitNode(op.lineinfo), + op.lineinfo, op.toStrLit, op[1].toStrLit, op[2].toStrLit)) @@ -153,5 +142,5 @@ macro expect*(exp: stmt): stmt = for i in countup(1, expectCall.len - 1): errorTypes.add(expectCall[i]) - result = getAst(expectBody(errorTypes, newStrLitNode(exp.lineinfo), body)) + result = getAst(expectBody(errorTypes, exp.lineinfo, body)) |