Author: jonathan
Date: Wed Nov 26 07:12:40 2008
New Revision: 33221
Modified:
trunk/languages/perl6/src/parser/actions.pm
Log:
[rakudo] Call panic on sub-nodes of EXPR nodes, which end up being PGE::Match
rather than Perl6::Grammar. This means we show the intended, helpful error.
Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Wed Nov 26 07:12:40 2008
@@ -2904,7 +2904,7 @@
# Check that we have a sub call.
if !$call.isa(PAST::Op) || $call.pasttype() ne 'call' {
- $/.panic('.= must have a call on the right hand side');
+ $/[0].panic('.= must have a call on the right hand side');
}
# Make a duplicate of the target node to receive result
@@ -2939,7 +2939,7 @@
if $rhs.isa(PAST::Op) && $rhs.pasttype() eq 'call' {
# Make sure we only have one initialization value.
if +@($rhs) > 2 {
- $/.panic("Role initialization can only supply a value for one
attribute");
+ $/[0].panic("Role initialization can only supply a value for
one attribute");
}
# Push role name and argument onto infix:does or infix:but.
$past.push($rhs[0]);