Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some infix:<xor> improvements -- two true values passed to xor or ^^
now result in Nil instead of a segfault-inducing Parrot Undef.
  • Loading branch information
pmichaud committed Aug 3, 2011
1 parent 20edd76 commit cefbda4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/Perl6/Actions.pm
Expand Up @@ -2561,11 +2561,8 @@ class Perl6::Actions is HLL::Actions {
else {
for $/.list { if $_.ast { $past.push($_.ast); } }
}
if $sym eq '^^' || $sym eq 'xor' {
# XXX Put something equivalent in place...or fix.
#$past := PAST::Op.new(
# :pasttype<call>, :name('!Undef_to_False'), $past
#);
if $past.pasttype eq 'xor_nqp' {
$past.push(PAST::Var.new(:named<false>, :scope<lexical_6model>, :name<Nil>));
}
if $key eq 'PREFIX' || $key eq 'INFIX' || $key eq 'POSTFIX' {
$past := whatever_curry($/, $past, $key eq 'INFIX' ?? 2 !! 1);
Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/Grammar.pm
Expand Up @@ -2202,7 +2202,7 @@ grammar Perl6::Grammar is HLL::Grammar {
token infix:sym<&&> { <sym> <O('%tight_and, :pasttype<if>')> }

token infix:sym<||> { <sym> <O('%tight_or, :assoc<left>, :pasttype<unless>')> }
token infix:sym<^^> { <sym> <O('%tight_or, :pasttype<xor>')> }
token infix:sym<^^> { <sym> <O('%tight_or, :pasttype<xor_nqp>')> }
token infix:sym<//> { <sym> <O('%tight_or, :assoc<left>, :pasttype<def_or>')> }
token infix:sym<min> { <sym> >> <O('%tight_or')> }
token infix:sym<max> { <sym> >> <O('%tight_or')> }
Expand Down Expand Up @@ -2284,7 +2284,7 @@ grammar Perl6::Grammar is HLL::Grammar {
token infix:sym<and> { <sym> >> <O('%loose_and, :pasttype<if>')> }

token infix:sym<or> { <sym> >> <O('%loose_or, :assoc<left>, :pasttype<unless>')> }
token infix:sym<xor> { <sym> >> <O('%loose_or, :pasttype<xor>')> }
token infix:sym<xor> { <sym> >> <O('%loose_or, :pasttype<xor_nqp>')> }
token infix:sym<orelse> { <sym> >> <O('%loose_or, :assoc<left>, :pasttype<def_or>')> }

token infix:sym«<==» { <sym> <O('%sequencer')> }
Expand Down
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2011.06-138-gf68aa56
2011.06-139-g4e5bf5f

0 comments on commit cefbda4

Please sign in to comment.