Skip to content

Commit 67647f7

Browse files
committed
Some more CharClassElement deparsing fixes
1 parent 0e218e3 commit 67647f7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/core.c/RakuAST/Deparse.pm6

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,14 +996,18 @@ class RakuAST::Deparse {
996996
multi method deparse(
997997
RakuAST::Regex::CharClassElement::Enumeration:D $ast
998998
--> Str:D) {
999-
'[' ~ $ast.elements.map({ self.deparse($_) }).join(' ') ~ ']'
999+
($ast.negated ?? '-' !! '+')
1000+
~ '[' ~ $ast.elements.map({ self.deparse($_) }).join(' ') ~ ']'
10001001
}
10011002

10021003
multi method deparse(
10031004
RakuAST::Regex::CharClassElement::Property:D $ast
10041005
--> Str:D) {
1005-
my str @parts = ':';
1006-
@parts.push('-') if $ast.inverted;
1006+
my str @parts;
1007+
1008+
@parts.push($ast.negated ?? '-' !! '+');
1009+
@parts.push(':');
1010+
@parts.push('!') if $ast.inverted;
10071011
@parts.push($ast.property);
10081012
@parts.push(self.deparse($_)) with $ast.predicate;
10091013
@parts.join

0 commit comments

Comments
 (0)