Skip to content
This repository
Browse code

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...
commit 872d3cd724ea3cc36e3db61cfba8808f5b031449 1 parent fc00f0c
Jonathan Worthington authored

Showing 1 changed file with 24 additions and 2 deletions. Show diff stats Hide diff stats

  1. +24 2 bin/perl6-debug.nqp
26 bin/perl6-debug.nqp
@@ -46,7 +46,29 @@ class Perl6::HookGrammar is Perl6::Grammar {
46 46 }
47 47 %seen_files{$file} := 1;
48 48 }
49   - Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'statementlist')(self)
  49 + my $cur_st_depth := $*ST_DEPTH;
  50 + {
  51 + my $*ST_DEPTH := $cur_st_depth + 1;
  52 + Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'statementlist')(self)
  53 + }
  54 + }
  55 +
  56 + method comp_unit() {
  57 + my $*ST_DEPTH := 0;
  58 + Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'comp_unit')(self)
  59 + }
  60 +
  61 + method blockoid() {
  62 + my $*ST_DEPTH := 0;
  63 + Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'blockoid')(self)
  64 + }
  65 +
  66 + method semilist() {
  67 + my $cur_st_depth := $*ST_DEPTH;
  68 + {
  69 + my $*ST_DEPTH := $cur_st_depth + 1;
  70 + Perl6::Grammar.HOW.find_method(Perl6::Grammar, 'semilist')(self)
  71 + }
50 72 }
51 73 }
52 74
@@ -73,7 +95,7 @@ class Perl6::HookActions is Perl6::Actions {
73 95
74 96 method statement($/) {
75 97 Perl6::Actions.statement($/);
76   - if $<EXPR> && interesting_expr($<EXPR>) {
  98 + if $*ST_DEPTH <= 1 && $<EXPR> && interesting_expr($<EXPR>) {
77 99 my $stmt := $/.ast;
78 100 my $pot_hash := nqp::istype($stmt, QAST::Op) &&
79 101 ($stmt.name eq '&infix:<,>' || $stmt.name eq '&infix:<=>>');

0 comments on commit 872d3cd

Please sign in to comment.
Something went wrong with that request. Please try again.