diff options
Diffstat (limited to 'compiler/vmgen.nim')
-rw-r--r-- | compiler/vmgen.nim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 9c6f8a970..5bb44785a 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -366,7 +366,7 @@ proc genIf(c: PCtx, n: PNode; dest: var TDest) = # Lend: if dest < 0 and not isEmptyType(n.typ): dest = getTemp(c, n.typ) var endings: seq[TPosition] = @[] - for i in countup(0, len(n) - 1): + for i in 0 ..< len(n): var it = n.sons[i] if it.len == 2: withTemp(tmp, it.sons[0].typ): @@ -436,7 +436,7 @@ proc sameConstant*(a, b: PNode): bool = of nkEmpty: result = true else: if sonsLen(a) == sonsLen(b): - for i in countup(0, sonsLen(a) - 1): + for i in 0 ..< sonsLen(a): if not sameConstant(a.sons[i], b.sons[i]): return result = true @@ -510,7 +510,7 @@ proc genTry(c: PCtx; n: PNode; dest: var TDest) = var blen = len(it) # first opcExcept contains the end label of the 'except' block: let endExcept = c.xjmp(it, opcExcept, 0) - for j in countup(0, blen - 2): + for j in 0 .. blen - 2: assert(it.sons[j].kind == nkType) let typ = it.sons[j].typ.skipTypes(abstractPtrs-{tyTypeDesc}) c.gABx(it, opcExcept, 0, c.genType(typ)) @@ -1739,10 +1739,10 @@ proc genArrAccess(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) = proc getNullValueAux(obj: PNode, result: PNode; conf: ConfigRef) = case obj.kind of nkRecList: - for i in countup(0, sonsLen(obj) - 1): getNullValueAux(obj.sons[i], result, conf) + for i in 0 ..< sonsLen(obj): getNullValueAux(obj.sons[i], result, conf) of nkRecCase: getNullValueAux(obj.sons[0], result, conf) - for i in countup(1, sonsLen(obj) - 1): + for i in 1 ..< sonsLen(obj): getNullValueAux(lastSon(obj.sons[i]), result, conf) of nkSym: let field = newNodeI(nkExprColonExpr, result.info) @@ -1784,11 +1784,11 @@ proc getNullValue(typ: PType, info: TLineInfo; conf: ConfigRef): PNode = getNullValueAux(t.n, result, conf) of tyArray: result = newNodeIT(nkBracket, info, t) - for i in countup(0, int(lengthOrd(conf, t)) - 1): + for i in 0 ..< int(lengthOrd(conf, t)): addSon(result, getNullValue(elemType(t), info, conf)) of tyTuple: result = newNodeIT(nkTupleConstr, info, t) - for i in countup(0, sonsLen(t) - 1): + for i in 0 ..< sonsLen(t): addSon(result, getNullValue(t.sons[i], info, conf)) of tySet: result = newNodeIT(nkCurly, info, t) |