Cleaned up the circular dependecies and remaining issues
Changed: The []= operator for strings and sequences is now capable of splicing
This commit is contained in:
parent
22546c44d1
commit
e3deb5b502
11 changed files with 105 additions and 100 deletions
|
|
@ -33,22 +33,6 @@ proc isTypeDesc(n: PNode): bool =
|
|||
result = true
|
||||
else: result = false
|
||||
|
||||
proc evalTemplateAux(templ, actual: PNode, sym: PSym): PNode =
|
||||
case templ.kind
|
||||
of nkSym:
|
||||
var p = templ.sym
|
||||
if (p.kind == skParam) and (p.owner.id == sym.id):
|
||||
result = copyTree(actual.sons[p.position])
|
||||
else:
|
||||
result = copyNode(templ)
|
||||
of nkNone..nkIdent, nkType..nkNilLit: # atom
|
||||
result = copyNode(templ)
|
||||
else:
|
||||
result = copyNode(templ)
|
||||
newSons(result, sonsLen(templ))
|
||||
for i in countup(0, sonsLen(templ) - 1):
|
||||
result.sons[i] = evalTemplateAux(templ.sons[i], actual, sym)
|
||||
|
||||
var evalTemplateCounter: int = 0
|
||||
# to prevend endless recursion in templates instantation
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue