Replace countup(x, y-1) with x ..< y

This commit is contained in:
Clyybber 2019-05-07 12:04:00 +02:00
commit f18b3af9d4
58 changed files with 312 additions and 312 deletions

View file

@ -256,7 +256,7 @@ proc genRecCommentAux(d: PDoc, n: PNode): Rope =
if n.kind in {nkStmtList, nkStmtListExpr, nkTypeDef, nkConstDef,
nkObjectTy, nkRefTy, nkPtrTy, nkAsgn, nkFastAsgn, nkHiddenStdConv}:
# notin {nkEmpty..nkNilLit, nkEnumTy, nkTupleTy}:
for i in countup(0, len(n)-1):
for i in 0 ..< len(n):
result = genRecCommentAux(d, n.sons[i])
if result != nil: return
else:
@ -284,7 +284,7 @@ proc getPlainDocstring(n: PNode): string =
if startsWith(n.comment, "##"):
result = n.comment
if result.len < 1:
for i in countup(0, safeLen(n)-1):
for i in 0 ..< safeLen(n):
result = getPlainDocstring(n.sons[i])
if result.len > 0: return
@ -838,13 +838,13 @@ proc generateDoc*(d: PDoc, n, orig: PNode) =
when useEffectSystem: documentRaises(d.cache, n)
genItem(d, n, n.sons[namePos], skConverter)
of nkTypeSection, nkVarSection, nkLetSection, nkConstSection:
for i in countup(0, sonsLen(n) - 1):
for i in 0 ..< sonsLen(n):
if n.sons[i].kind != nkCommentStmt:
# order is always 'type var let const':
genItem(d, n.sons[i], n.sons[i].sons[0],
succ(skType, ord(n.kind)-ord(nkTypeSection)))
of nkStmtList:
for i in countup(0, sonsLen(n) - 1): generateDoc(d, n.sons[i], orig)
for i in 0 ..< sonsLen(n): generateDoc(d, n.sons[i], orig)
of nkWhenStmt:
# generate documentation for the first branch only:
if not checkForFalse(n.sons[0].sons[0]):
@ -892,13 +892,13 @@ proc generateJson*(d: PDoc, n: PNode, includeComments: bool = true) =
when useEffectSystem: documentRaises(d.cache, n)
d.add genJsonItem(d, n, n.sons[namePos], skConverter)
of nkTypeSection, nkVarSection, nkLetSection, nkConstSection:
for i in countup(0, sonsLen(n) - 1):
for i in 0 ..< sonsLen(n):
if n.sons[i].kind != nkCommentStmt:
# order is always 'type var let const':
d.add genJsonItem(d, n.sons[i], n.sons[i].sons[0],
succ(skType, ord(n.kind)-ord(nkTypeSection)))
of nkStmtList:
for i in countup(0, sonsLen(n) - 1):
for i in 0 ..< sonsLen(n):
generateJson(d, n.sons[i], includeComments)
of nkWhenStmt:
# generate documentation for the first branch only:
@ -935,13 +935,13 @@ proc generateTags*(d: PDoc, n: PNode, r: var Rope) =
when useEffectSystem: documentRaises(d.cache, n)
r.add genTagsItem(d, n, n.sons[namePos], skConverter)
of nkTypeSection, nkVarSection, nkLetSection, nkConstSection:
for i in countup(0, sonsLen(n) - 1):
for i in 0 ..< sonsLen(n):
if n.sons[i].kind != nkCommentStmt:
# order is always 'type var let const':
r.add genTagsItem(d, n.sons[i], n.sons[i].sons[0],
succ(skType, ord(n.kind)-ord(nkTypeSection)))
of nkStmtList:
for i in countup(0, sonsLen(n) - 1):
for i in 0 ..< sonsLen(n):
generateTags(d, n.sons[i], r)
of nkWhenStmt:
# generate documentation for the first branch only: