diff options
author | Araq <rumpf_a@web.de> | 2014-04-14 08:45:43 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-04-14 08:45:43 +0200 |
commit | b961e47bfe519bf456a3e8a0dba3025a3c047b04 (patch) | |
tree | 1054a10c42d5c1d0205d14b9ea655218c6be2508 /lib | |
parent | 817337af304b8cdf8b96754ae039044840333a02 (diff) | |
download | Nim-b961e47bfe519bf456a3e8a0dba3025a3c047b04.tar.gz |
new concurrency model: first steps; shared is not a keyword anymore
Diffstat (limited to 'lib')
-rw-r--r-- | lib/packages/docutils/highlite.nim | 6 | ||||
-rw-r--r-- | lib/system.nim | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim index c507f5e1c..80fbf3a51 100644 --- a/lib/packages/docutils/highlite.nim +++ b/lib/packages/docutils/highlite.nim @@ -52,7 +52,7 @@ const "finally", "for", "from", "generic", "if", "import", "in", "include", "interface", "is", "isnot", "iterator", "lambda", "let", "macro", "method", "mixin", "mod", "nil", "not", "notin", "object", "of", "or", "out", "proc", - "ptr", "raise", "ref", "return", "shared", "shl", "shr", "static", + "ptr", "raise", "ref", "return", "shl", "shr", "static", "template", "try", "tuple", "type", "using", "var", "when", "while", "with", "without", "xor", "yield"] @@ -61,6 +61,7 @@ proc getSourceLanguage*(name: string): TSourceLanguage = if cmpIgnoreStyle(name, sourceLanguageToStr[i]) == 0: return i result = langNone + proc initGeneralTokenizer*(g: var TGeneralTokenizer, buf: cstring) = g.buf = buf g.kind = low(TTokenClass) @@ -70,6 +71,7 @@ proc initGeneralTokenizer*(g: var TGeneralTokenizer, buf: cstring) = var pos = 0 # skip initial whitespace: while g.buf[pos] in {' ', '\x09'..'\x0D'}: inc(pos) g.pos = pos + proc initGeneralTokenizer*(g: var TGeneralTokenizer, buf: string) = initGeneralTokenizer(g, cstring(buf)) @@ -554,7 +556,7 @@ when isMainModule: let input = string(readFile(filename)) keywords = input.split() break - doAssert (not keywords.isNil, "Couldn't read any keywords.txt file!") + doAssert(not keywords.isNil, "Couldn't read any keywords.txt file!") doAssert keywords.len == nimrodKeywords.len, "No matching lengths" for i in 0..keywords.len-1: #echo keywords[i], " == ", nimrodKeywords[i] diff --git a/lib/system.nim b/lib/system.nim index 3cb6b08d5..dae418b7f 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -77,7 +77,7 @@ type TNumber* = TInteger|TReal ## type class matching all number types - + proc defined*(x: expr): bool {.magic: "Defined", noSideEffect.} ## Special compile-time procedure that checks whether `x` is ## defined. `x` has to be an identifier or a qualified identifier. @@ -188,6 +188,11 @@ when not defined(niminheritable): when not defined(nimunion): {.pragma: unchecked.} +when defined(nimNewShared): + type + `shared`* {.magic: "Shared".} + guarded* {.magic: "Guarded".} + const NoFakeVars* = defined(NimrodVM) ## true if the backend doesn't support \ ## "fake variables" like 'var EBADF {.importc.}: cint'. @@ -784,7 +789,8 @@ proc `is` *[T, S](x: T, y: S): bool {.magic: "Is", noSideEffect.} ## assert(test[int](3) == 3) ## assert(test[string]("xyz") == 0) template `isnot` *(x, y: expr): expr {.immediate.} = not (x is y) - ## Negated version of `is`. Equivalent to `not(is(x,y))` + ## Negated version of `is`. Equivalent to ``not(x is y)``. + proc `of` *[T, S](x: T, y: S): bool {.magic: "Of", noSideEffect.} ## Checks if `x` has a type of `y` ## |