diff options
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/tmarshal.nim | 2 | ||||
-rw-r--r-- | tests/stdlib/tnre.nim | 17 | ||||
-rw-r--r-- | tests/stdlib/tpegs.nim | 22 |
3 files changed, 21 insertions, 20 deletions
diff --git a/tests/stdlib/tmarshal.nim b/tests/stdlib/tmarshal.nim index 6a53a2964..434caa281 100644 --- a/tests/stdlib/tmarshal.nim +++ b/tests/stdlib/tmarshal.nim @@ -9,7 +9,7 @@ omega 200 import marshal -template testit(x: expr) = discard $$to[type(x)]($$x) +template testit(x) = discard $$to[type(x)]($$x) var x: array[0..4, array[0..4, string]] = [ ["test", "1", "2", "3", "4"], ["test", "1", "2", "3", "4"], diff --git a/tests/stdlib/tnre.nim b/tests/stdlib/tnre.nim index 030319ebf..fabbb69a8 100644 --- a/tests/stdlib/tnre.nim +++ b/tests/stdlib/tnre.nim @@ -20,12 +20,13 @@ discard """ [Suite] Misc tests''' """ + import nre -import nre.init -import nre.captures -import nre.find -import nre.split -import nre.match -import nre.replace -import nre.escape -import nre.misc +import nre/init +import nre/captures +import nre/find +import nre/split +import nre/match +import nre/replace +import nre/escape +import nre/misc diff --git a/tests/stdlib/tpegs.nim b/tests/stdlib/tpegs.nim index ec839e288..e2a5a1715 100644 --- a/tests/stdlib/tpegs.nim +++ b/tests/stdlib/tpegs.nim @@ -149,7 +149,7 @@ proc addChoice(dest: var TPeg, elem: TPeg) = else: add(dest, elem) else: add(dest, elem) -template multipleOp(k: TPegKind, localOpt: expr) = +template multipleOp(k: TPegKind, localOpt) = result.kind = k result.sons = @[] for x in items(a): @@ -350,32 +350,32 @@ proc newNonTerminal*(name: string, line, column: int): PNonTerminal {. result.line = line result.col = column -template letters*: expr = +template letters*: TPeg = ## expands to ``charset({'A'..'Z', 'a'..'z'})`` charset({'A'..'Z', 'a'..'z'}) -template digits*: expr = +template digits*: TPeg = ## expands to ``charset({'0'..'9'})`` charset({'0'..'9'}) -template whitespace*: expr = +template whitespace*: TPeg = ## expands to ``charset({' ', '\9'..'\13'})`` charset({' ', '\9'..'\13'}) -template identChars*: expr = +template identChars*: TPeg = ## expands to ``charset({'a'..'z', 'A'..'Z', '0'..'9', '_'})`` charset({'a'..'z', 'A'..'Z', '0'..'9', '_'}) -template identStartChars*: expr = +template identStartChars*: TPeg = ## expands to ``charset({'A'..'Z', 'a'..'z', '_'})`` charset({'a'..'z', 'A'..'Z', '_'}) -template ident*: expr = +template ident*: TPeg = ## same as ``[a-zA-Z_][a-zA-z_0-9]*``; standard identifier sequence(charset({'a'..'z', 'A'..'Z', '_'}), *charset({'a'..'z', 'A'..'Z', '0'..'9', '_'})) -template natural*: expr = +template natural*: TPeg = ## same as ``\d+`` +digits @@ -534,10 +534,10 @@ proc bounds*(c: TCaptures, when not useUnicode: type Rune = char - template fastRuneAt(s, i, ch: expr) = + template fastRuneAt(s, i, ch) = ch = s[i] inc(i) - template runeLenAt(s, i: expr): expr = 1 + template runeLenAt(s, i): untyped = 1 proc isAlpha(a: char): bool {.inline.} = return a in {'a'..'z','A'..'Z'} proc isUpper(a: char): bool {.inline.} = return a in {'A'..'Z'} @@ -847,7 +847,7 @@ proc findAll*(s: string, pattern: TPeg, start = 0): seq[string] {. ## If it does not match, @[] is returned. accumulateResult(findAll(s, pattern, start)) -template `=~`*(s: string, pattern: TPeg): expr = +template `=~`*(s: string, pattern: TPeg): untyped = ## This calls ``match`` with an implicit declared ``matches`` array that ## can be used in the scope of the ``=~`` call: ## |