Chomp until you see a certain string or until you run out of characters to chomp!
Single-line Comment You could define single-line comments like this:
const singleLineComment: P.Parser<P.Unit> = P.symbol("--") .skip(P.chompUntilEndOr("\n"));
A file may end with a single-line comment, so the file can end before you see a newline. Tricky!
I recommend just using lineComment for this particular scenario.
Chomp until you see a certain string or until you run out of characters to chomp!
Remarks
Example
Single-line Comment You could define single-line comments like this:
A file may end with a single-line comment, so the file can end before you see a newline. Tricky!
I recommend just using lineComment for this particular scenario.