Permalink
Browse files

Get $var.++ and $var.() working.

$var.:<++> etc is also parsed now, but is not functional.
  • Loading branch information...
1 parent 1fca644 commit ce3ea3924be21d974a5f6a43f9f701be415052e0 @Mouq Mouq committed with moritz Sep 1, 2013
Showing with 16 additions and 5 deletions.
  1. +12 −2 src/Perl6/Actions.nqp
  2. +4 −3 src/Perl6/Grammar.nqp
View
@@ -3703,7 +3703,13 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
method postop($/) {
- make $<postfix> ?? $<postfix>.ast !! $<postcircumfix>.ast;
+ if $<postfix> {
+ make $<postfix>.ast
+ || QAST::Op.new( :name('&postfix:<' ~ $<postfix>.Str ~ '>'), :op<call> )
+ } else {
+ make $<postcircumfix>.ast
+ || QAST::Op.new( :name('&postcircumfix:<' ~ $<postcircumfix>.Str ~ '>'), :op<call> );
+ }
}
method dotty:sym<.>($/) { make $<dottyop>.ast; }
@@ -3722,9 +3728,13 @@ class Perl6::Actions is HLL::Actions does STDActions {
method dottyop($/) {
if $<methodop> {
make $<methodop>.ast;
- } else {
+ }
+ elsif $<postop> {
make $<postop>.ast;
}
+ else {
+ make $<colonpair>.ast;
+ }
}
method privop($/) {
@@ -3135,8 +3135,8 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
token postop {
- | <postfix>
- | <postcircumfix>
+ | <postfix> $<O> = {$<postfix><O>} $<sym> = {$<postfix><sym>}
+ | <postcircumfix> $<O> = {$<postcircumfix><O>} $<sym> = {$<postcircumfix><sym>}
}
proto token prefix_circumfix_meta_operator { <...> }
@@ -3230,7 +3230,8 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
:dba('dotty method or postfix')
[
| <methodop>
- | <!alpha> <postop>
+ | <colonpair>
+ | <!alpha> <postop> $<O> = {$<postop><O>} $<sym> = {$<postop><sym>}
]
}

0 comments on commit ce3ea39

Please sign in to comment.