Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
include annotations in dump
  • Loading branch information
TimToady committed Dec 14, 2015
1 parent ed362a9 commit a2fe8eb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/QAST/Node.nqp
Expand Up @@ -109,6 +109,25 @@ class QAST::Node {
if nqp::chars($extra) {
nqp::push(@chunks, "($extra)");
}
if nqp::ishash(%!annotations) {
for %!annotations {
my $k := $_.key;
nqp::push(@chunks, ' :' ~ $k);
my $v := $_.value;
try {
if nqp::isconcrete($v) {
if $k eq 'context' {
nqp::push(@chunks, '<' ~ $v ~ '>');
}
elsif $k eq 'sink_ok' || $k eq 'WANTED' || $k eq 'final' {
}
else { # dunno how to introspect
nqp::push(@chunks, '<?>');
}
}
}
}
}
if (self.node) {
nqp::push(@chunks, ' ');
my $escaped_node := nqp::escape(self.node);
Expand Down

0 comments on commit a2fe8eb

Please sign in to comment.