attempt to merge newtempl

This commit is contained in:
Araq 2013-12-24 14:04:18 +01:00
commit 83a0a31276
5 changed files with 646 additions and 6 deletions

View file

@ -476,6 +476,8 @@ proc semTemplateDef(c: PContext, n: PNode): PNode =
SymTabReplace(c.currentScope.symbols, proto, s)
if n.sons[patternPos].kind != nkEmpty:
c.patterns.add(s)
#if s.name.s == "move":
# echo renderTree(result)
proc semPatternBody(c: var TemplCtx, n: PNode): PNode =
template templToExpand(s: expr): expr =
@ -602,5 +604,5 @@ proc semPattern(c: PContext, n: PNode): PNode =
if result.len == 1:
result = result.sons[0]
elif result.len == 0:
LocalError(n.info, errInvalidExpression)
localError(n.info, errInvalidExpression)
closeScope(c)