Permalink
Browse files

Be smarter about what statements we hit as we single step; those in a…

… semilist are most likely uninteresting, so avoid them.
  • Loading branch information...
1 parent fc00f0c commit 872d3cd724ea3cc36e3db61cfba8808f5b031449 @jnthn committed Aug 19, 2012
Showing with 24 additions and 2 deletions.
  1. +24 −2 bin/perl6-debug.nqp
View
26 bin/perl6-debug.nqp
@@ -46,7 +46,29 @@ class Perl6::HookGrammar is Perl6::Grammar {
}
%seen_files{$file} := 1;
}
- Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'statementlist')(self)
+ my $cur_st_depth := $*ST_DEPTH;
+ {
+ my $*ST_DEPTH := $cur_st_depth + 1;
+ Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'statementlist')(self)
+ }
+ }
+
+ method comp_unit() {
+ my $*ST_DEPTH := 0;
+ Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'comp_unit')(self)
+ }
+
+ method blockoid() {
+ my $*ST_DEPTH := 0;
+ Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'blockoid')(self)
+ }
+
+ method semilist() {
+ my $cur_st_depth := $*ST_DEPTH;
+ {
+ my $*ST_DEPTH := $cur_st_depth + 1;
+ Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'semilist')(self)
+ }
}
}
@@ -73,7 +95,7 @@ class Perl6::HookActions is Perl6::Actions {
method statement($/) {
Perl6::Actions.statement($/);
- if $<EXPR> && interesting_expr($<EXPR>) {
+ if $*ST_DEPTH <= 1 && $<EXPR> && interesting_expr($<EXPR>) {
my $stmt := $/.ast;
my $pot_hash := nqp::istype($stmt, QAST::Op) &&
($stmt.name eq '&infix:<,>' || $stmt.name eq '&infix:<=>>');

0 comments on commit 872d3cd

Please sign in to comment.