Somebody needs to document `scanp`, it's awesome.
import strscans
from strutils import Whitespace
let line = " ; abc "
var idx = 0
var comment = ""
if scanp(line, idx, *`Whitespace`, {'#',';'}):
let start = idx
if scanp(line, idx, +(~{'\C', '\L', '\0'} -> comment.add($_))):
echo "found a comment ##", comment, "## starting at: ", start
- nre, am I using it wrongly? vsajip
- Re: nre, am I using it wrongly? vsajip
- Re: nre, am I using it wrongly? Araq
- Re: nre, am I using it wrongly? stbalbach
- Re: nre, am I using it wrongly? planhths
