Skip to content

Commit

Permalink
Make it easier to spot errors in Match.perl
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Feb 8, 2016
1 parent c387d6c commit a5d1e94
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/Match.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ my class Match is Capture is Cool {

multi method perl(Match:D:) {
my %attrs;
for <orig from to ast list hash> {
%attrs{$_} = self."$_"().perl;
}
%attrs.ASSIGN-KEY("orig", self.orig.perl);
%attrs.ASSIGN-KEY("from", self.from.perl);
%attrs.ASSIGN-KEY("to", self.to.perl );
%attrs.ASSIGN-KEY("ast", self.ast.perl );
%attrs.ASSIGN-KEY("list", self.list.perl);
%attrs.ASSIGN-KEY("hash", self.hash.perl);

'Match.new('
~ %attrs.fmt('%s => %s', ', ')
Expand Down

0 comments on commit a5d1e94

Please sign in to comment.