import { sepBy } from "https://deno.land/x/pazza@v0.3.0/mod.ts";
Execute the embedded parser in specified times, with another parser as separator, then produce a list of values.
If separator is trailing, it will be treated as the rest of input without parsing.
sepBy(char(","), digit())("1,2").output; // ==> ["1", "2"]
sepBy(char(","), digit())("1,2,").output; // ==> ["1", "2"]
sepBy(char(","), digit())("1,2,").input === ",";
sepBy(char(","), digit(), 1)("").ok === false;
sepBy(char(","), digit(), 0, 1)("1,2").output; // ==> ["1"]
sepBy(char(","), digit(), 0, 1)("1,2").input === ",2";