Barring Perl 6, one thing you can do is lift the unique prefixes up
into the rule you want to fail, e.g.:
ENTITY : ( '#' commit COMMENT
| IDENT '=' commit OPTION
| TYPE NAME '{' commit DECLARATION
| 'scope' commit SCOPE
)(s)
COMMENT : m/.*/
OPTION : VALUE
Hi Sean and other P::RD participants,
Sean O'Rourke schrieb:
Barring Perl 6, one thing you can do is lift the unique prefixes up
into the rule you want to fail, e.g.:
ENTITY : ( '#' commit COMMENT
| IDENT '=' commit OPTION
| TYPE NAME '{' commit DECLARATION
| 'scope'
Hi P::RD lovers,
is there a general advice to shortcut an alternation in a rule
if one already commited subrule fails:
Example:
ENTITY : ( COMMENT | OPTION | DECLARATION | SCOPE )(s)
COMMENT : '#' commit m/.*/
| error? reject
OPTION : IDENT '=' commit VALUE
{