parent
aa95ae6af9
commit
ed1d41c51e
54 changed files with 559 additions and 573 deletions
|
|
@ -31,7 +31,7 @@ proc hashTree(n: PNode): Hash =
|
|||
of nkStrLit..nkTripleStrLit:
|
||||
result = result !& hash(n.strVal)
|
||||
else:
|
||||
for i in 0 ..< sonsLen(n):
|
||||
for i in 0 ..< len(n):
|
||||
result = result !& hashTree(n.sons[i])
|
||||
|
||||
proc treesEquivalent(a, b: PNode): bool =
|
||||
|
|
@ -46,8 +46,8 @@ proc treesEquivalent(a, b: PNode): bool =
|
|||
of nkFloatLit..nkFloat64Lit: result = a.floatVal == b.floatVal
|
||||
of nkStrLit..nkTripleStrLit: result = a.strVal == b.strVal
|
||||
else:
|
||||
if sonsLen(a) == sonsLen(b):
|
||||
for i in 0 ..< sonsLen(a):
|
||||
if len(a) == len(b):
|
||||
for i in 0 ..< len(a):
|
||||
if not treesEquivalent(a.sons[i], b.sons[i]): return
|
||||
result = true
|
||||
if result: result = sameTypeOrNil(a.typ, b.typ)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue