Y
Hacker News
new
|
ask
|
show
|
jobs
by
ahoka
926 days ago
Parser combinations are very powerful! For example your function whitespace_tokens could be something like:
whitespace_tokens = many1(choice(‘ ‘, ‘\t’, ‘\n’)).map(m -> token(m))