pub fn optional<'a, I>(input: I) -> IResult<I, Optional<I>, Error<I>>
Expand description
Parses an optional
as defined in the grammar spec.
§Grammar
optional = '(' text-in-optional+ ')'
text-in-optional = (- optional-to-escape) | ('\', optional-to-escape)
optional-to-escape = '(' | ')' | '{' | '/' | '\'
§Example
(name)
(with spaces)
(escaped \/\{\()
(no need to escape })
(🦀)
§Errors
§Recoverable Error
- If
input
doesn’t start with(
.