diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-07-30 16:07:33 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-07-30 16:34:42 +0200 |
commit | 8876ed23f1dc6d12a8ae7bf061b7e31c3adf54b4 (patch) | |
tree | 849c2cb53e205f2fc48418f88ab9acdd783f9137 /lib/pure | |
parent | 86d4090cd890b6159f93c455f60c5f3ef56a1d27 (diff) | |
download | Nim-8876ed23f1dc6d12a8ae7bf061b7e31c3adf54b4.tar.gz |
expr and stmt are now deprecated
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/algorithm.nim | 4 | ||||
-rw-r--r-- | lib/pure/collections/sets.nim | 4 | ||||
-rw-r--r-- | lib/pure/os.nim | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index c0acae138..eee4fab22 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -114,7 +114,7 @@ proc lowerBound*[T](a: openArray[T], key: T, cmp: proc(x,y: T): int {.closure.}) proc lowerBound*[T](a: openArray[T], key: T): int = lowerBound(a, key, cmp[T]) proc merge[T](a, b: var openArray[T], lo, m, hi: int, cmp: proc (x, y: T): int {.closure.}, order: SortOrder) = - template `<-` (a, b: expr) = + template `<-` (a, b) = when false: a = b elif onlySafeCode: @@ -206,7 +206,7 @@ proc sorted*[T](a: openArray[T], cmp: proc(x, y: T): int {.closure.}, result[i] = a[i] sort(result, cmp, order) -template sortedByIt*(seq1, op: expr): expr = +template sortedByIt*(seq1, op: untyped): untyped = ## Convenience template around the ``sorted`` proc to reduce typing. ## ## The template injects the ``it`` variable which you can use directly in an diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index da32c1950..552e41ef7 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -256,7 +256,7 @@ proc incl*[A](s: var HashSet[A], other: HashSet[A]) = assert other.isValid, "The set `other` needs to be initialized." for item in other: incl(s, item) -template doWhile(a: expr, b: stmt): stmt = +template doWhile(a, b) = while true: b if not a: break @@ -371,7 +371,7 @@ proc toSet*[A](keys: openArray[A]): HashSet[A] = result = initSet[A](rightSize(keys.len)) for key in items(keys): result.incl(key) -template dollarImpl(): stmt {.dirty.} = +template dollarImpl() {.dirty.} = result = "{" for key in items(s): if result.len > 1: result.add(", ") diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 65bbab3d4..e6ecb184e 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1502,7 +1502,7 @@ type lastWriteTime*: Time # Time file was last modified/written to. creationTime*: Time # Time file was created. Not supported on all systems! -template rawToFormalFileInfo(rawInfo, formalInfo): expr = +template rawToFormalFileInfo(rawInfo, formalInfo): untyped = ## Transforms the native file info structure into the one nim uses. ## 'rawInfo' is either a 'TBY_HANDLE_FILE_INFORMATION' structure on Windows, ## or a 'Stat' structure on posix @@ -1533,7 +1533,7 @@ template rawToFormalFileInfo(rawInfo, formalInfo): expr = else: - template checkAndIncludeMode(rawMode, formalMode: expr) = + template checkAndIncludeMode(rawMode, formalMode: untyped) = if (rawInfo.st_mode and rawMode) != 0'i32: formalInfo.permissions.incl(formalMode) formalInfo.id = (rawInfo.st_dev, rawInfo.st_ino) |