diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-10-29 08:55:30 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-10-29 08:55:30 +0100 |
commit | 6a3288a60e78c9b17f2640fff20ab94969914974 (patch) | |
tree | 5946b02ce048d67c70f99b8636c6afcd5c082cd4 /lib/core | |
parent | 70ea45cdbaa9d26a7196ab2718f60c9ca77e2d12 (diff) | |
download | Nim-6a3288a60e78c9b17f2640fff20ab94969914974.tar.gz |
more replacements for the deprecated '<'
Diffstat (limited to 'lib/core')
-rw-r--r-- | lib/core/macros.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 22c479a4a..d3f541153 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -839,7 +839,7 @@ proc newNilLit*(): NimNode {.compileTime.} = ## New nil literal shortcut result = newNimNode(nnkNilLit) -proc last*(node: NimNode): NimNode {.compileTime.} = node[<node.len] +proc last*(node: NimNode): NimNode {.compileTime.} = node[node.len-1] ## Return the last item in nodes children. Same as `node[^1]` @@ -887,7 +887,7 @@ proc newIfStmt*(branches: varargs[tuple[cond, body: NimNode]]): proc copyChildrenTo*(src, dest: NimNode) {.compileTime.}= ## Copy all children from `src` to `dest` - for i in 0 .. < src.len: + for i in 0 ..< src.len: dest.add src[i].copyNimTree template expectRoutine(node: NimNode) = @@ -1107,7 +1107,7 @@ proc eqIdent*(node: NimNode; s: string): bool {.compileTime.} = proc hasArgOfName* (params: NimNode; name: string): bool {.compiletime.}= ## Search nnkFormalParams for an argument. assert params.kind == nnkFormalParams - for i in 1 .. <params.len: + for i in 1 ..< params.len: template node: untyped = params[i] if name.eqIdent( $ node[0]): return true |