Skip to content

Commit

Permalink
Fix test failures.
Browse files Browse the repository at this point in the history
I left a few needed lines out in the refactoring.
  • Loading branch information
ingydotnet committed Dec 11, 2014
1 parent 83554f9 commit 523c3e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/Inline/CPP.pm
Expand Up @@ -287,7 +287,8 @@ sub info {
# Generate a C++ parser
#============================================================================
sub get_parser {
return Inline::CPP::Parser::RecDescent->get_parser_recdescent();
my $o = shift;
return Inline::CPP::Parser::RecDescent::get_parser_recdescent($o);
}

#============================================================================
Expand Down
12 changes: 9 additions & 3 deletions lib/Inline/CPP/Parser/RecDescent.pm
Expand Up @@ -17,17 +17,23 @@ sub register {
}

sub get_parser {
return Inline::CPP::Parser::RecDescent::get_parser_recdescent();
my $o = shift;
return Inline::CPP::Parser::RecDescent::get_parser_recdescent($o);
}

sub get_parser_recdescent {
my $o = shift;
eval { require Parse::RecDescent };
croak <<END if $@;
This invocation of Inline requires the Parse::RecDescent module.
$@
END
$main::RD_HINT++;
Parse::RecDescent->new(grammar())
no warnings qw/ once /; ## no critic (warnings)
$::RD_HINT = 1; # Turns on Parse::RecDescent's warnings/diagnostics.
my $parser = Parse::RecDescent->new(grammar());
$parser->{data}{typeconv} = $o->{ILSM}{typeconv};
$parser->{ILSM} = $o->{ILSM}; # give parser access to config options
return $parser;
}

use vars qw($TYPEMAP_KIND $class_part $class_decl $star);
Expand Down

0 comments on commit 523c3e9

Please sign in to comment.