diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-07-29 17:35:51 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-07-29 23:51:01 +0200 |
commit | 60b187513ed8e2a061816a912e372a1c81794d50 (patch) | |
tree | 9ee88f0234c633d232b55fc9bbe2cca38b2b0866 /lib/impure | |
parent | 9ee5b5eabca9455f0c31a89c865013afa5a2c39e (diff) | |
download | Nim-60b187513ed8e2a061816a912e372a1c81794d50.tar.gz |
stdlib and compiler don't use .immediate anymore
Diffstat (limited to 'lib/impure')
-rw-r--r-- | lib/impure/nre.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim index 76a0f3db6..557bb0549 100644 --- a/lib/impure/nre.nim +++ b/lib/impure/nre.nim @@ -274,7 +274,7 @@ proc `[]`*(pattern: Captures, name: string): string = let pattern = RegexMatch(pattern) return pattern.captures[pattern.pattern.captureNameToId.fget(name)] -template toTableImpl(cond: bool): stmt {.immediate, dirty.} = +template toTableImpl(cond: untyped) {.dirty.} = for key in RegexMatch(pattern).pattern.captureNameId.keys: let nextVal = pattern[key] if cond: @@ -291,7 +291,7 @@ proc toTable*(pattern: CaptureBounds, default = none(Slice[int])): result = initTable[string, Option[Slice[int]]]() toTableImpl(nextVal.isNone) -template itemsImpl(cond: bool): stmt {.immediate, dirty.} = +template itemsImpl(cond: untyped) {.dirty.} = for i in 0 .. <RegexMatch(pattern).pattern.captureCount: let nextVal = pattern[i] # done in this roundabout way to avoid multiple yields (potential code @@ -625,7 +625,7 @@ proc split*(str: string, pattern: Regex, maxSplit = -1, start = 0): seq[string] result.add(str.substr(bounds.b + 1, str.high)) template replaceImpl(str: string, pattern: Regex, - replacement: expr): stmt {.immediate, dirty.} = + replacement: untyped) {.dirty.} = # XXX seems very similar to split, maybe I can reduce code duplication # somehow? result = "" |