Hi,
I know that at some point ignorable products was optimized and resulted in undefined (=== random) values in actions, but hell let me do what I mean.
Doc says pass reference to value and I'm passing it reference to undef.
It worked just fine at some point but then it was broken.
Responsible change is
dae6a5697dec6a5bb039418e3329db615e535dec and the following part in particular:
- push @{$token_values}, ${$value_ref};
+ my $value = ${$value_ref};
+ last SET_VALUE_IX if not defined $value;
+ push @{$token_values}, $value;
I don't see how it is related to whole change.
Also, I see that "# Position 1 is reserved for undef" in $token_values then this probably just a bug and the following should be applied:
diff --git a/cpan/lib/Marpa/R2/Recognizer.pm b/cpan/lib/Marpa/R2/Recognizer.pm
index d700590..219e839 100644
--- a/cpan/lib/Marpa/R2/Recognizer.pm
+++ b/cpan/lib/Marpa/R2/Recognizer.pm
@@ -669,10 +669,9 @@ sub Marpa::R2::Recognizer::alternative {
{
Marpa::R2::exception('alternative(): value must be undef or ref');
} ## end if ( $ref_type ne 'SCALAR' and $ref_type ne 'REF' and...)
+ last SET_VALUE_IX if not defined $$value_ref;
$value_ix = scalar @{$token_values};
- my $value = ${$value_ref};
- last SET_VALUE_IX if not defined $value;
- push @{$token_values}, $value;
+ push @{$token_values}, $$value_ref;
} ## end SET_VALUE_IX:
$length //= 1;