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 | |
parent | 86d4090cd890b6159f93c455f60c5f3ef56a1d27 (diff) | |
download | Nim-8876ed23f1dc6d12a8ae7bf061b7e31c3adf54b4.tar.gz |
expr and stmt are now deprecated
Diffstat (limited to 'lib')
-rw-r--r-- | lib/posix/posix.nim | 2 | ||||
-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 | ||||
-rw-r--r-- | lib/system.nim | 6 |
5 files changed, 11 insertions, 9 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index cd21b5c8b..bd69b2328 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -2667,7 +2667,7 @@ proc utimes*(path: cstring, times: ptr array[2, Timeval]): int {. proc handle_signal(sig: cint, handler: proc (a: cint) {.noconv.}) {.importc: "signal", header: "<signal.h>".} -template onSignal*(signals: varargs[cint], body: untyped): stmt = +template onSignal*(signals: varargs[cint], body: untyped) = ## Setup code to be executed when Unix signals are received. Example: ## from posix import SIGINT, SIGTERM ## onSignal(SIGINT, SIGTERM): 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) diff --git a/lib/system.nim b/lib/system.nim index 0c7eaea95..6a9b52d24 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -66,8 +66,10 @@ type `ref`* {.magic: Pointer.}[T] ## built-in generic traced pointer type `nil` {.magic: "Nil".} - expr* {.magic: Expr.} ## meta type to denote an expression (for templates) - stmt* {.magic: Stmt.} ## meta type to denote a statement (for templates) + expr* {.magic: Expr, deprecated.} ## meta type to denote an expression (for templates) + ## **Deprecated** since version 0.15. Use ``untyped`` instead. + stmt* {.magic: Stmt, deprecated.} ## meta type to denote a statement (for templates) + ## **Deprecated** since version 0.15. Use ``typed`` instead. typedesc* {.magic: TypeDesc.} ## meta type to denote a type description void* {.magic: "VoidType".} ## meta type to denote the absence of any type auto* {.magic: Expr.} ## meta type for automatic type determination |