Author: jonathan
Date: Tue Mar 25 12:03:39 2008
New Revision: 26544
Modified:
trunk/languages/perl6/src/parser/actions.pm
trunk/languages/perl6/src/parser/grammar.pg
Log:
[rakudo] Implement pairs of the form :a(...) (postcircumfix:()).
Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Tue Mar 25 12:03:39 2008
@@ -1251,8 +1251,15 @@
elsif $key eq 'value' {
$pair_key := PAST::Val.new( :value(~$<ident>) );
if $<postcircumfix> {
- # XXX TODO
- $/.panic('postcircumfix on colonpair not yet implemented');
+ # What type of postcircumfix?
+ my $type := substr($<val>, 0, 1);
+ if $type eq '(' {
+ my $val := $( $<postcircumfix><semilist> );
+ $pair_val := $val[0];
+ }
+ else {
+ $/.panic($type ~ ' postcircumfix colonpairs not yet
implemented');
+ }
}
else {
$pair_val := PAST::Val.new( :value(1), :returns('Integer') );
Modified: trunk/languages/perl6/src/parser/grammar.pg
==============================================================================
--- trunk/languages/perl6/src/parser/grammar.pg (original)
+++ trunk/languages/perl6/src/parser/grammar.pg Tue Mar 25 12:03:39 2008
@@ -658,7 +658,7 @@
':'
[
| '!' <ident> {*} #= false
- | <ident> [ <.unsp>? <postcircumfix> ]? {*} #= value
+ | <ident> $<val>=[ <.unsp>? <postcircumfix> ]? {*} #= value
| <postcircumfix> {*} #= structural
| <sigil> <twigil>? <desigilname> {*} #= varname
]