Skip to content

Commit a2fe8eb

Browse files
committed
include annotations in dump
1 parent ed362a9 commit a2fe8eb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/QAST/Node.nqp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,25 @@ class QAST::Node {
109109
if nqp::chars($extra) {
110110
nqp::push(@chunks, "($extra)");
111111
}
112+
if nqp::ishash(%!annotations) {
113+
for %!annotations {
114+
my $k := $_.key;
115+
nqp::push(@chunks, ' :' ~ $k);
116+
my $v := $_.value;
117+
try {
118+
if nqp::isconcrete($v) {
119+
if $k eq 'context' {
120+
nqp::push(@chunks, '<' ~ $v ~ '>');
121+
}
122+
elsif $k eq 'sink_ok' || $k eq 'WANTED' || $k eq 'final' {
123+
}
124+
else { # dunno how to introspect
125+
nqp::push(@chunks, '<?>');
126+
}
127+
}
128+
}
129+
}
130+
}
112131
if (self.node) {
113132
nqp::push(@chunks, ' ');
114133
my $escaped_node := nqp::escape(self.node);

0 commit comments

Comments
 (0)