Skip to content

Commit

Permalink
Eliminated named arguments for r->value(): t+
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Kegler authored and Jeffrey Kegler committed May 19, 2012
1 parent 282d797 commit 52b9224
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions r2/lib/Marpa/R2/Value.pm
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,16 @@ sub Marpa::R2::Internal::Recognizer::evaluate {

# Returns false if no parse
sub Marpa::R2::Recognizer::value {
my ( $recce, @arg_hashes ) = @_;
my ( $recce ) = @_;

Marpa::R2::exception("Too many arguments to Marpa::R2::Recognizer::value")
if scalar @_ != 1;

my $recce_c = $recce->[Marpa::R2::Internal::Recognizer::C];
my $order = $recce->[Marpa::R2::Internal::Recognizer::O_C];

my $parse_set_arg = $recce->[Marpa::R2::Internal::Recognizer::END];


$recce->set(@arg_hashes);

local $Marpa::R2::Internal::TRACE_FH =
$recce->[Marpa::R2::Internal::Recognizer::TRACE_FILE_HANDLE];

Expand Down
3 changes: 2 additions & 1 deletion r2/t/implementation.t
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ Marpa::R2::Test::is( $show_earley_sets_output, $expected_earley_sets,

my $trace_output;
open my $trace_fh, q{>}, \$trace_output;
$value_ref = $recce->value( { trace_fh => $trace_fh, trace_values => 1 } );
$recce->set( { trace_fh => $trace_fh, trace_values => 1 } );
$value_ref = $recce->value();
$recce->set( { trace_fh => \*STDOUT, trace_values => 0 } );
close $trace_fh;

Expand Down
4 changes: 2 additions & 2 deletions r2/t/leo2.t
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ LEO_FLAG: for my $leo_flag ( 0, 1 ) {
Marpa::R2::Test::is( $max_size, $expected_size,
"Leo flag $leo_flag, size" );

my $value_ref = $recce->value( {} );
my $value_ref = $recce->value();
my $value = $value_ref ? ${$value_ref} : 'No parse';
Marpa::R2::Test::is( $value, 'a' x $length, 'Leo p166 parse' );
} ## end for my $leo_flag ( 0, 1 )
Expand All @@ -109,7 +109,7 @@ LEO_FLAG: for my $leo_flag ( 0, 1 ) {
}
);
for ( 1 .. $length ) { $recce->read( 'a', 'a' ); }
my $value_ref = $recce->value( {} );
my $value_ref = $recce->value();
close $trace_fh;
my $warning_found =
( $trace_output
Expand Down
2 changes: 1 addition & 1 deletion r2/t/leo3.t
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ LEO_FLAG: for my $leo_flag ( 0, 1 ) {
Marpa::R2::Test::is( $max_size, $expected_size,
"Leo flag $leo_flag, size $max_size" );

my $value_ref = $recce->value( {} );
my $value_ref = $recce->value();
my $value = $value_ref ? ${$value_ref} : 'No parse';
Marpa::R2::Test::is( $value, 'a' x $length, 'Leo p166 parse' );

Expand Down
2 changes: 1 addition & 1 deletion r2/t/leo_cycle.t
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ my $show_earley_sets_output = do {
Marpa::R2::Test::is( $recce->show_earley_sets(1),
$show_earley_sets_output, 'Leo cycle Earley sets' );

my $value_ref = $recce->value( {} );
my $value_ref = $recce->value();
my $value = $value_ref ? ${$value_ref} : 'No parse';
Marpa::R2::Test::is( $value, 'a' x $length, 'Leo cycle parse' );

Expand Down
3 changes: 2 additions & 1 deletion r2/t/leo_example.t
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ END_EARLEY_SETS

my $trace_output;
open my $trace_fh, q{>}, \$trace_output;
my $value_ref = $recce->value( { trace_fh => $trace_fh, trace_values => 1 } );
$recce->set( { trace_fh => $trace_fh, trace_values => 1 } );
my $value_ref = $recce->value();
close $trace_fh;

my $value = ref $value_ref ? ${$value_ref} : 'No Parse';
Expand Down

0 comments on commit 52b9224

Please sign in to comment.