Subject: | HOP::Parser::optional sub truncates returned values list to head |
Optional sub only returns head of value list. Problem is values are
likely to be dropped when optional-ed parser is actually the result of a
concatenate combinator. Here follows my proposed fix:
sub optional {
my $parser = shift;
return alternate (
#T($parser, sub { [ shift ] }), # broken 0.01
$parser, # fixed
\&null_list,
);
}
I believe this is Perl version and platform agnostic.