Skip to content

Commit

Permalink
[FIX] use mixin for strscans.scanp (#17371)
Browse files Browse the repository at this point in the history
  • Loading branch information
haxscramper authored Mar 19, 2021
1 parent 8e8bea9 commit 430c302
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pure/strscans.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
echo repr result

0 comments on commit 430c302

Please sign in to comment.