diff options
Diffstat (limited to 'compiler/trees.nim')
-rw-r--r-- | compiler/trees.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/trees.nim b/compiler/trees.nim index 55a3c619e..c1adee863 100644 --- a/compiler/trees.nim +++ b/compiler/trees.nim @@ -45,7 +45,7 @@ proc exprStructuralEquivalent*(a, b: PNode; strictSymEquality=false): bool = of nkEmpty, nkNilLit, nkType: result = true else: if sonsLen(a) == sonsLen(b): - for i in countup(0, sonsLen(a) - 1): + for i in 0 ..< sonsLen(a): if not exprStructuralEquivalent(a.sons[i], b.sons[i], strictSymEquality): return result = true @@ -69,7 +69,7 @@ proc sameTree*(a, b: PNode): bool = of nkEmpty, nkNilLit, nkType: result = true else: if sonsLen(a) == sonsLen(b): - for i in countup(0, sonsLen(a) - 1): + for i in 0 ..< sonsLen(a): if not sameTree(a.sons[i], b.sons[i]): return result = true @@ -101,7 +101,7 @@ proc isDeepConstExpr*(n: PNode): bool = if not isDeepConstExpr(n.sons[i]): return false if n.typ.isNil: result = true else: - let t = n.typ.skipTypes({tyGenericInst, tyDistinct, tyAlias, tySink}) + let t = n.typ.skipTypes({tyGenericInst, tyDistinct, tyAlias, tySink, tyOwned}) if t.kind in {tyRef, tyPtr}: return false if t.kind != tyObject or not isCaseObj(t.n): result = true @@ -121,7 +121,7 @@ proc whichPragma*(n: PNode): TSpecialWord = if key.kind == nkIdent: result = whichKeyword(key.ident) proc effectSpec*(n: PNode, effectType: TSpecialWord): PNode = - for i in countup(0, sonsLen(n) - 1): + for i in 0 ..< sonsLen(n): var it = n.sons[i] if it.kind == nkExprColonExpr and whichPragma(it) == effectType: result = it.sons[1] |