Skip to content

Commit

Permalink
RakuAST: Implement deparse of Regex::SequentialConjunction
Browse files Browse the repository at this point in the history
Includes a fix for deparse of Regex::Conjuction - that one should
generate &, not &&
  • Loading branch information
niner committed Nov 20, 2022
1 parent 9d5f35a commit 46d8c1a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core.c/RakuAST/Deparse.pm6
Expand Up @@ -36,7 +36,8 @@ class RakuAST::Deparse {
has str $.regex-close = ' /';
has str $.regex-alternation = ' | ';
has str $.regex-sequential-alternation = ' || ';
has str $.regex-conjunction = ' && ';
has str $.regex-conjunction = ' & ';
has str $.regex-sequential-conjunction = ' && ';

has str $.before-infix = ' ';
has str $.after-infix = ' ';
Expand Down Expand Up @@ -992,6 +993,10 @@ class RakuAST::Deparse {
self!branches($ast, $.regex-sequential-alternation)
}

multi method deparse(RakuAST::Regex::SequentialConjunction:D $ast --> str) {
self!branches($ast, $.regex-sequential-conjunction)
}

multi method deparse(RakuAST::Signature:D $ast --> str) {
if $ast.parameters -> @parameters {
my $parts := nqp::list_s;
Expand Down

0 comments on commit 46d8c1a

Please sign in to comment.