feat: optional spaces and whitespaces #76
Labels
A-parsers
Area: Issues related to parsers
C-feature-accepted
Category: A feature request that has been accepted and awaiting implementation
P-medium
Priority: Medium
Uh oh!
There was an error while loading. Please reload this page.
What problem does this feature solve?
Currently the
whitespace
parser is strict and requires at least one character to be matched. There are many cases where I need to wrap it intooptional
parser e.g. the spaces before and after argument braces are optional.Describe the solution
I think aligning this parser with other API would be a little bit more convenient by matching the current pairs such as
many
andmany1
,sepBy
andsepBy1
:whitespaces1
- requires a single or multiple characters, works as the currentwhitespace
whitespaces
- requires zero or more whitespaces to match, works asoptional(whitespace)
wrapWhitespaces
andwrapWhitespaces1
- that should prevent writing the common pattern of surrounding whitespaces over and over again:The text was updated successfully, but these errors were encountered: