deprecated unary '<'

This commit is contained in:
Andreas Rumpf 2017-10-29 08:37:13 +01:00
commit 70ea45cdba
56 changed files with 259 additions and 258 deletions

View file

@ -133,7 +133,7 @@ proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode =
result.typ = t
if result.kind == nkSym: result.sym = replaceTypeVarsS(cl, n.sym)
let isCall = result.kind in nkCallKinds
for i in 0 .. <n.safeLen:
for i in 0 ..< n.safeLen:
# XXX HACK: ``f(a, b)``, avoid to instantiate `f`
if isCall and i == 0: result.add(n[i])
else: result.add(prepareNode(cl, n[i]))
@ -151,7 +151,7 @@ proc hasGenericArguments*(n: PNode): bool =
(n.sym.kind == skType and
n.sym.typ.flags * {tfGenericTypeParam, tfImplicitTypeParam} != {})
else:
for i in 0.. <n.safeLen:
for i in 0..<n.safeLen:
if hasGenericArguments(n.sons[i]): return true
return false
@ -166,13 +166,13 @@ proc reResolveCallsWithTypedescParams(cl: var TReplTypeVars, n: PNode): PNode =
# overload resolution is executed again (which may trigger generateInstance).
if n.kind in nkCallKinds and sfFromGeneric in n[0].sym.flags:
var needsFixing = false
for i in 1 .. <n.safeLen:
for i in 1 ..< n.safeLen:
if isTypeParam(n[i]): needsFixing = true
if needsFixing:
n.sons[0] = newSymNode(n.sons[0].sym.owner)
return cl.c.semOverloadedCall(cl.c, n, n, {skProc, skFunc}, {})
for i in 0 .. <n.safeLen:
for i in 0 ..< n.safeLen:
n.sons[i] = reResolveCallsWithTypedescParams(cl, n[i])
return n
@ -385,11 +385,11 @@ proc eraseVoidParams*(t: PType) =
if t.sons[0] != nil and t.sons[0].kind == tyVoid:
t.sons[0] = nil
for i in 1 .. <t.sonsLen:
for i in 1 ..< t.sonsLen:
# don't touch any memory unless necessary
if t.sons[i].kind == tyVoid:
var pos = i
for j in i+1 .. <t.sonsLen:
for j in i+1 ..< t.sonsLen:
if t.sons[j].kind != tyVoid:
t.sons[pos] = t.sons[j]
t.n.sons[pos] = t.n.sons[j]
@ -399,7 +399,7 @@ proc eraseVoidParams*(t: PType) =
return
proc skipIntLiteralParams*(t: PType) =
for i in 0 .. <t.sonsLen:
for i in 0 ..< t.sonsLen:
let p = t.sons[i]
if p == nil: continue
let skipped = p.skipIntLit
@ -500,7 +500,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType =
bailout()
result = instCopyType(cl, t)
idTablePut(cl.localCache, t, result)
for i in 1 .. <result.sonsLen:
for i in 1 ..< result.sonsLen:
result.sons[i] = replaceTypeVarsT(cl, result.sons[i])
propagateToOwner(result, result.lastSon)