Skip to content

Commit

Permalink
Some JVM compatibility fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 3, 2013
1 parent 6b8fc4f commit e014aaf
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions bin/perl6-debug.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,26 @@ class Perl6::HookActions is Perl6::Actions {
sub interesting_expr($e) {
my $accept := 1;
for $e.hash {
if %uninteresting{$_.key} {
my $key := $_.key;
my $value := $_.value;
if %uninteresting{$key} {
$accept := 0;
last;
}
if $_.key eq 'scope_declarator' && $_.value<sym> eq 'has' {
if $key eq 'scope_declarator' && $value<sym> eq 'has' {
$accept := 0;
last;
}
if $_.key eq 'scope_declarator' && $_.value<sym> eq 'my' || $_.value<sym> eq 'our' {
if $_.value<scoped><declarator> -> $decl {
if $key eq 'scope_declarator' && ($value<sym> eq 'my' || $value<sym> eq 'our') {
if $value<scoped><declarator> -> $decl {
# Skip plain, boring declarations with no assignment.
if $decl<variable_declarator> && !$decl<initializer> {
$accept := 0;
last;
}
}
}
if $_.key eq 'circumfix' && $e<circumfix><pblock> {
if $key eq 'circumfix' && $e<circumfix><pblock> {
$accept := 0;
last;
}
Expand Down Expand Up @@ -418,11 +420,13 @@ class Perl6::HookGrammar is Perl6::Grammar {

method comment:sym<#>() {
my $c := Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'comment:sym<#>')(self);
my $comment := $c.MATCH.Str;
if $comment ~~ /'#?BREAK'/ {
if $*DEBUG_HOOKS.has_hook('new_breakpoint') {
my $file := nqp::getlexcaller('$?FILES') // '<unknown>';
$*DEBUG_HOOKS.get_hook('new_breakpoint')($file, $c.MATCH().from());
if $c {
my $comment := $c.MATCH.Str;
if $comment ~~ /'#?BREAK'/ {
if $*DEBUG_HOOKS.has_hook('new_breakpoint') {
my $file := nqp::getlexcaller('$?FILES') // '<unknown>';
$*DEBUG_HOOKS.get_hook('new_breakpoint')($file, $c.MATCH().from());
}
}
}
$c
Expand All @@ -446,12 +450,9 @@ class Perl6::Debugger is Perl6::Compiler {
}
}

sub MAIN(@ARGS) {
sub MAIN(*@ARGS) {
# Initialize dynops.
pir::rakudo_dynop_setup__v();

# Bump up Parrot's recursion limit
pir::getinterp__P().recursion_limit(100000);
nqp::p6init();

# Create and configure compiler object.
my $comp := Perl6::Debugger.new();
Expand All @@ -464,6 +465,9 @@ sub MAIN(@ARGS) {
my $COMPILER_CONFIG := $comp.config;
nqp::bindhllsym('perl6', '$COMPILER_CONFIG', $comp.config);

# Bump up recursion limit, for VMs that have one.
$comp.recursion_limit(100000);

# Add extra command line options.
my @clo := $comp.commandline_options();
@clo.push('setting=s');
Expand Down

0 comments on commit e014aaf

Please sign in to comment.