Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
propagate --rxtrace (and its trace depth for indents) to inner languages
  • Loading branch information
diakopter committed May 26, 2012
1 parent 5e21bba commit 9befba5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/HLL/Grammar.pm
Expand Up @@ -834,6 +834,9 @@ An operator precedence parser.

method LANG($lang, $regex) {
my $lang_cursor := %*LANG{$lang}.'!cursor_init'(self.target(), :p(self.pos()));
if self.HOW.traced(self) {
$lang_cursor.HOW.trace-on($lang_cursor, self.HOW.trace_depth(self));
}
my $*ACTIONS := %*LANG{$lang ~ '-actions'};
$lang_cursor."$regex"();
}
Expand Down
12 changes: 10 additions & 2 deletions src/how/NQPClassHOW.pm
Expand Up @@ -462,6 +462,14 @@ knowhow NQPClassHOW {
$!name
}

method traced($obj) {
$!trace
}

method trace_depth($obj) {
$!trace_depth
}

method attributes($obj, :$local!) {
my @attrs;
for %!attributes {
Expand Down Expand Up @@ -551,9 +559,9 @@ knowhow NQPClassHOW {
##
## Tracing
##
method trace-on($obj) {
method trace-on($obj, $depth?) {
$!trace := 1;
$!trace_depth := 0;
$!trace_depth := $depth // 0;
pir::set_method_cache_authoritativeness__0Pi($obj, 0);
pir::publish_method_cache($obj, nqp::hash());
}
Expand Down

0 comments on commit 9befba5

Please sign in to comment.