This adds support for using a custom directive as the first optional
group element. The first optional group element guards the parsing of
the rest of the optional group. This can be done for custom directives
by expecting the parse function to return an OptionalParseResult
instead of a ParseResult.
Depends on D159243