mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
[FIX] use mixin for strscans.scanp (#17371)
This commit is contained in:
@@ -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
|
||||
echo repr result
|
||||
|
||||
Reference in New Issue
Block a user