Browse files

[GGE::Perl6Regex] check .Bool rather than .defined

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...
1 parent a38e8db commit 71c611a572bcfcda31a9646e2e6378156aeef833 @masak committed May 22, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/GGE/Perl6Regex.pm
View
6 lib/GGE/Perl6Regex.pm
@@ -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);
}
}

0 comments on commit 71c611a

Please sign in to comment.