Skip to content

Commit

Permalink
[GGE::Perl6Regex] check .Bool rather than .defined
Browse files Browse the repository at this point in the history
The code was the way it was because it turns out that Nil is defined in
Rakudo, whereas it should be undefined. The solution employed involved
descending into some nodes twice, which caused other problems. The solution
new employed simply checks for boolean truth... which should work in all
cases. I think.
  • Loading branch information
Carl Masak committed May 22, 2010
1 parent a38e8db commit 71c611a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/GGE/Perl6Regex.pm
Expand Up @@ -637,9 +637,9 @@ class GGE::Perl6Regex {
$exp.clear;
for @old-children -> $old-child {
my $new-child = perl6exp($old-child, %pad);
# RAKUDO: Storing the result into a variable causes it to become
# defined.
if defined perl6exp($old-child, %pad) {
# XXX: Should really be testing definedness, like PGE. Not sure
# that it matters, though.
if $new-child {
$exp.push($new-child);
}
}
Expand Down

0 comments on commit 71c611a

Please sign in to comment.