[FIX] use mixin for strscans.scanp (#17371)

This commit is contained in:
haxscramper 2021-03-19 22:16:52 +03:00 • committed by GitHub
commit 430c30299f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -577,6 +577,7 @@ macro scanp*(input, idx: typed; pattern: varargs[untyped]): bool =
of nnkCallKinds: of nnkCallKinds:
# *{'A'..'Z'} !! s.add(!_) # *{'A'..'Z'} !! s.add(!_)
template buildWhile(input, idx, init, cond, action): untyped = template buildWhile(input, idx, init, cond, action): untyped =
mixin hasNxt
while hasNxt(input, idx): while hasNxt(input, idx):
init init
if not cond: break if not cond: break