summary refs log tree commit diff stats
path: root/compiler/ccgstmts.nim
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2019-05-07 12:37:28 +0200
committerClyybber <darkmine956@gmail.com>2019-05-07 12:37:28 +0200
commitcc28eef38e601171644ffe1a2775744eaaca8123 (patch)
tree720cfdcb95072394a62d365cc18f7b6c71ffe031 /compiler/ccgstmts.nim
parentf18b3af9d4a6393ba988cdb17d8f0861b1c75c7d (diff)
downloadNim-cc28eef38e601171644ffe1a2775744eaaca8123.tar.gz
Replace countup(x, y) with x .. y
Diffstat (limited to 'compiler/ccgstmts.nim')
-rw-r--r--compiler/ccgstmts.nim16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim
index 7d0367938..3be31503a 100644
--- a/compiler/ccgstmts.nim
+++ b/compiler/ccgstmts.nim
@@ -65,7 +65,7 @@ proc genVarTuple(p: BProc, n: PNode) =
   var L = sonsLen(n)
 
   # if we have a something that's been captured, use the lowering instead:
-  for i in countup(0, L-3):
+  for i in 0 .. L-3:
     if n[i].kind != nkSym:
       genStmts(p, lowerTupleUnpacking(p.module.g.graph, n, p.prc))
       return
@@ -99,7 +99,7 @@ proc genVarTuple(p: BProc, n: PNode) =
   genLineDir(p, n)
   initLocExpr(p, n.sons[L-1], tup)
   var t = tup.t.skipTypes(abstractInst)
-  for i in countup(0, L-3):
+  for i in 0 .. L-3:
     let vn = n.sons[i]
     let v = vn.sym
     if sfCompileTime in v.flags: continue
@@ -202,7 +202,7 @@ proc blockLeaveActions(p: BProc, howManyTrys, howManyExcepts: int) =
 
   var stack = newSeq[tuple[n: PNode, inExcept: bool]](0)
 
-  for i in countup(1, howManyTrys):
+  for i in 1 .. howManyTrys:
     let tryStmt = p.nestedTryStmts.pop
     if not p.module.compileToCpp or optNoCppExceptions in p.config.globalOptions:
       # Pop safe points generated by try
@@ -709,7 +709,7 @@ template genCaseGenericBranch(p: BProc, b: PNode, e: TLoc,
   var
     x, y: TLoc
   var length = sonsLen(b)
-  for i in countup(0, length - 2):
+  for i in 0 .. length - 2:
     if b.sons[i].kind == nkRange:
       initLocExpr(p, b.sons[i].sons[0], x)
       initLocExpr(p, b.sons[i].sons[1], y)
@@ -768,7 +768,7 @@ proc genCaseStringBranch(p: BProc, b: PNode, e: TLoc, labl: TLabel,
                          branches: var openArray[Rope]) =
   var x: TLoc
   var length = sonsLen(b)
-  for i in countup(0, length - 2):
+  for i in 0 .. length - 2:
     assert(b.sons[i].kind != nkRange)
     initLocExpr(p, b.sons[i], x)
     assert(b.sons[i].kind in {nkStrLit..nkTripleStrLit})
@@ -799,7 +799,7 @@ proc genStringCase(p: BProc, t: PNode, d: var TLoc) =
         discard
     linefmt(p, cpsStmts, "switch (#hashString($1) & $2) {$n",
             [rdLoc(a), bitMask])
-    for j in countup(0, high(branches)):
+    for j in 0 .. high(branches):
       if branches[j] != nil:
         lineF(p, cpsStmts, "case $1: $n$2break;$n",
              [intLiteral(j), branches[j]])
@@ -813,7 +813,7 @@ proc genStringCase(p: BProc, t: PNode, d: var TLoc) =
     genCaseGeneric(p, t, d, "", "if (#eqStrings($1, $2)) goto $3;$n")
 
 proc branchHasTooBigRange(b: PNode): bool =
-  for i in countup(0, sonsLen(b)-2):
+  for i in 0 .. sonsLen(b)-2:
     # last son is block
     if (b.sons[i].kind == nkRange) and
         b.sons[i].sons[1].intVal - b.sons[i].sons[0].intVal > RangeExpandLimit:
@@ -1054,7 +1054,7 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) =
       endBlock(p)
     else:
       var orExpr: Rope = nil
-      for j in countup(0, blen - 2):
+      for j in 0 .. blen - 2:
         assert(t.sons[i].sons[j].kind == nkType)
         if orExpr != nil: add(orExpr, "||")
         let checkFor = if optNimV2 in p.config.globalOptions: