We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It would be great to have a "lazy" alternative to flatten() that respects map(), pick(n) etc.
I don´t know if there is something that would only work with this new feature but some intuitive options would "work as expected" like:
Parser bracketStringTemplate(Parser content) => (char('[') & content & char(']')).pick(1).lazyFlatten(); Parser bracketStringGeneral() => bracketStringTemplate(noneOf('[]').star());
or
Parser bracketStringTemplate(Parser content) => content.skip(before: char('['), after: char(']')).lazyFlatten(); Parser bracketStringGeneral() => bracketStringTemplate(noneOf('[]').star());
or even
Parser bracketStringTemplate(Parser content) => content.skip(before: char('['), after: char(']')); Parser bracketStringGeneral() => bracketStringTemplate(noneOf('[]').star()).lazyFlatten();
which must currently be rewritten to:
Parser bracketStringTemplate(Parser content) => (char('[') & content.flatten() & char(']')).pick(1); Parser bracketStringGeneral() => bracketStringTemplate(noneOf('[]').star());
The text was updated successfully, but these errors were encountered:
Thank you for the suggestion, but not clear how that could be implemented in a general way?
I typically create explicit helper functions that create more complicated compositions of common parser patterns, much like in your last example.
Sorry, something went wrong.
No branches or pull requests
It would be great to have a "lazy" alternative to flatten() that respects map(), pick(n) etc.
I don´t know if there is something that would only work with this new feature but some intuitive options would "work as expected" like:
or
or even
which must currently be rewritten to:
The text was updated successfully, but these errors were encountered: