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

@ -20,7 +20,7 @@ proc renderPlainSymbolName*(n: PNode): string =
result = ""
case n.kind
of nkPostfix, nkAccQuoted:
result = renderPlainSymbolName(n[<n.len])
result = renderPlainSymbolName(n[n.len-1])
of nkIdent:
result = n.ident.s
of nkSym:
@ -58,8 +58,8 @@ proc renderType(n: PNode): string =
assert params.kind == nkFormalParams
assert len(params) > 0
result = "proc("
for i in 1 .. <len(params): result.add(renderType(params[i]) & ',')
result[<len(result)] = ')'
for i in 1 ..< len(params): result.add(renderType(params[i]) & ',')
result[len(result)-1] = ')'
else:
result = "proc"
of nkIdentDefs:
@ -67,18 +67,18 @@ proc renderType(n: PNode): string =
let typePos = len(n) - 2
let typeStr = renderType(n[typePos])
result = typeStr
for i in 1 .. <typePos:
for i in 1 ..< typePos:
assert n[i].kind == nkIdent
result.add(',' & typeStr)
of nkTupleTy:
result = "tuple["
for i in 0 .. <len(n): result.add(renderType(n[i]) & ',')
result[<len(result)] = ']'
for i in 0 ..< len(n): result.add(renderType(n[i]) & ',')
result[len(result)-1] = ']'
of nkBracketExpr:
assert len(n) >= 2
result = renderType(n[0]) & '['
for i in 1 .. <len(n): result.add(renderType(n[i]) & ',')
result[<len(result)] = ']'
for i in 1 ..< len(n): result.add(renderType(n[i]) & ',')
result[len(result)-1] = ']'
else: result = ""
assert(not result.isNil)
@ -91,7 +91,7 @@ proc renderParamTypes(found: var seq[string], n: PNode) =
## generator does include the information.
case n.kind
of nkFormalParams:
for i in 1 .. <len(n): renderParamTypes(found, n[i])
for i in 1 ..< len(n): renderParamTypes(found, n[i])
of nkIdentDefs:
# These are parameter names + type + default value node.
let typePos = len(n) - 2
@ -102,7 +102,7 @@ proc renderParamTypes(found: var seq[string], n: PNode) =
let typ = n[typePos+1].typ
if not typ.isNil: typeStr = typeToString(typ, preferExported)
if typeStr.len < 1: return
for i in 0 .. <typePos:
for i in 0 ..< typePos:
found.add(typeStr)
else:
internalError(n.info, "renderParamTypes(found,n) with " & $n.kind)