next steps towards term rewriting macros; simple examples work

This commit is contained in:
Araq
2012-08-30 22:55:32 +02:00
parent 1786e30991
commit 1d14cb1ad8
17 changed files with 124 additions and 56 deletions

View File

@@ -46,7 +46,7 @@ type
nnkYieldStmt, nnkTryStmt, nnkFinally, nnkRaiseStmt,
nnkReturnStmt, nnkBreakStmt, nnkContinueStmt, nnkBlockStmt, nnkStaticStmt,
nnkDiscardStmt, nnkStmtList, nnkImportStmt, nnkFromStmt,
nnkIncludeStmt, nnkBindStmt, nnkPatternStmt,
nnkIncludeStmt, nnkBindStmt, nnkPattern,
nnkCommentStmt, nnkStmtListExpr, nnkBlockExpr,
nnkStmtListType, nnkBlockType, nnkTypeOfExpr, nnkObjectTy,
nnkTupleTy, nnkRecList, nnkRecCase, nnkRecWhen,

View File

@@ -92,7 +92,9 @@ template fail* =
TestStatusIMPL = FAILED
checkpoints = @[]
macro check*(conditions: stmt): stmt =
macro check*(conditions: stmt): stmt =
let conditions = callsite()
proc standardRewrite(e: PNimrodNode): PNimrodNode =
template rewrite(Exp, lineInfoLit: expr, expLit: string): stmt =
if not Exp: