diff options
author | haxscramper <haxscramper@gmail.com> | 2021-03-19 22:16:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-19 20:16:52 +0100 |
commit | 430c30299f4c1cc5632d89c37487a78d4b4b3fde (patch) | |
tree | 6bb14a14081b75b3b2088eb15ea6537ca0c02fef /lib | |
parent | 8e8bea9044f0ae1f0583cb6130f6fbac390bf26a (diff) | |
download | Nim-430c30299f4c1cc5632d89c37487a78d4b4b3fde.tar.gz |
[FIX] use `mixin` for strscans.scanp (#17371)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/strscans.nim | 3 |
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 |