You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often, a rule's production contains only one capturing subrule, like this:
foo: / a / bar / b /
Here only bar is a capturing subrule while neither / a / nor / b / do.
Hopefully the pegex engine can recognize such productions at compile time and avoid always creating a single-element Perl array for every got_foo() call. This way we can not only save some runtime overhead and can also save customized got_foo function definitions in the user receiver class. For example, I've found myself keep writing quite a lot of boring stubs for such productions like below:
subgot_foo() {
my ($self, $list) = @_;
$list->[0];
}
The text was updated successfully, but these errors were encountered:
@agentzh, can you please finish this out by providing a rule for bar and some
parsable input. Again if you can use this one-liner form, it is most helpful
for reproduction:
Often, a rule's production contains only one capturing subrule, like this:
Here only
bar
is a capturing subrule while neither/ a /
nor/ b /
do.Hopefully the pegex engine can recognize such productions at compile time and avoid always creating a single-element Perl array for every
got_foo()
call. This way we can not only save some runtime overhead and can also save customizedgot_foo
function definitions in the user receiver class. For example, I've found myself keep writing quite a lot of boring stubs for such productions like below:The text was updated successfully, but these errors were encountered: