summary refs log tree commit diff stats
path: root/lib/pure/strscans.nim
diff options
context:
space:
mode:
authorhaxscramper <haxscramper@gmail.com>2021-03-19 22:16:52 +0300
committerGitHub <noreply@github.com>2021-03-19 20:16:52 +0100
commit430c30299f4c1cc5632d89c37487a78d4b4b3fde (patch)
tree6bb14a14081b75b3b2088eb15ea6537ca0c02fef /lib/pure/strscans.nim
parent8e8bea9044f0ae1f0583cb6130f6fbac390bf26a (diff)
downloadNim-430c30299f4c1cc5632d89c37487a78d4b4b3fde.tar.gz
[FIX] use `mixin` for strscans.scanp (#17371)
Diffstat (limited to 'lib/pure/strscans.nim')
-rw-r--r--lib/pure/strscans.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pure/strscans.nim b/lib/pure/strscans.nim
index 6bedf2de2..73b53e3d6 100644
--- a/lib/pure/strscans.nim
+++ b/lib/pure/strscans.nim
@@ -577,6 +577,7 @@ macro scanp*(input, idx: typed; pattern: varargs[untyped]): bool =
     of nnkCallKinds:
       # *{'A'..'Z'} !! s.add(!_)
       template buildWhile(input, idx, init, cond, action): untyped =
+        mixin hasNxt
         while hasNxt(input, idx):
           init
           if not cond: break
@@ -688,4 +689,4 @@ macro scanp*(input, idx: typed; pattern: varargs[untyped]): bool =
   result.add toIfChain(conds, idx, res, 0)
   result.add res
   when defined(debugScanp):
-    echo repr result
\ No newline at end of file
+    echo repr result