Skip to content

Commit

Permalink
Couple of Grammar::Debugger updates so it works on latest Rakudo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Nov 4, 2011
1 parent 4689eef commit 2d8307c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Grammar/Debugger.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ multi trait_mod:<will>(Method $m, $cond, :$break!) is export {
$m.breakpoint-condition = $cond;
}

my class DebuggedGrammarHOW is Metamodel::GrammarHOW is Mu {
my class DebuggedGrammarHOW is Mu is Metamodel::GrammarHOW {
has $!indent = 0;
has $!auto-continue = False;
has $!stop-at-fail = False;
Expand All @@ -22,6 +22,7 @@ my class DebuggedGrammarHOW is Metamodel::GrammarHOW is Mu {
has %!cond-breakpoints;

method add_method(Mu $obj, $name, $code) {
callsame;
if $code.?breakpoint {
if $code.?breakpoint-condition {
%!cond-breakpoints{$code.name} = $code.breakpoint-condition;
Expand All @@ -30,12 +31,11 @@ my class DebuggedGrammarHOW is Metamodel::GrammarHOW is Mu {
@!breakpoints.push($code.name);
}
}
nextsame;
}

method find_method($obj, $name) {
my $meth := callsame;
substr($name, 0, 1) eq '!' || $name eq any(<parse CREATE Bool defined MATCH>) ??
substr($name, 0, 1) eq '!' || $name eq any(<parse CREATE BUILD Bool defined MATCH>) ??
$meth !!
-> $c, |$args {
# Method name.
Expand All @@ -44,7 +44,7 @@ my class DebuggedGrammarHOW is Metamodel::GrammarHOW is Mu {
# Call rule.
self.intervene(EnterRule, $name);
$!indent++;
my $result := $meth($obj, |$args);
my $result := $meth($c, |$args);
$!indent--;

# Dump result.
Expand Down

0 comments on commit 2d8307c

Please sign in to comment.