-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
customSepByWithSequenceOf
of tutorial 4 does allow trailing comma
#110
Comments
The const sepByTrailing = <T>(sep: Parser<string>, val: Parser<T>) =>
coroutine((run) => {
const results: T[] = [];
while (true) {
const valResult = run(either(val));
if (valResult.isError) break;
results.push(valResult.value);
const sepResult = run(either(sep));
if (sepResult.isError) break;
}
return results;
}); I used I
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With following code, copied almost unchanged from tutorial 4 (changes are in template arguments, to workaround #109):
I get:
customSepByWithSequenceOf
is unable to parse a list with trailing comma, which according to https://github.com/francisrstokes/arcsecond/blob/main/tutorial/tutorial-part-4.md#writing-custom-combinators it should be able to do.Please find a complete example in https://github.com/devurandom/arcsecond-issue-110-repro.
The text was updated successfully, but these errors were encountered: