Skip to content

Commit

Permalink
RakuAST: fix deparsing issue, and simplify some rakufication
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jul 31, 2023
1 parent 5e353bc commit f7a314b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core.c/RakuAST/Deparse.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,18 @@ class RakuAST::Deparse {
@parts.push(':');
@parts.push('!') if $ast.inverted;
@parts.push($ast.property);
@parts.push(self.deparse($_)) with $ast.predicate;

with $ast.predicate {
if nqp::istype($_,RakuAST::StrLiteral) {
@parts.push('<');
@parts.push(self.deparse-unquoted($_));
@parts.push('>');
}
else {
@parts.push(self.deparse($_))
}
}

@parts.join
}

Expand Down
3 changes: 3 additions & 0 deletions src/core.c/RakuAST/Raku.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ augment class RakuAST::Node {
'implicit-topic', -> {
:implicit-topic if self.implicit-topic
},
'inverted', -> {
:inverted if self.inverted
},
'labels', -> {
my $labels := nqp::decont(self.labels);
:$labels if $labels
Expand Down

0 comments on commit f7a314b

Please sign in to comment.