Author: kjs
Date: Tue Mar 25 08:45:07 2008
New Revision: 26533
Modified:
trunk/compilers/nqp/src/Grammar/Actions.pir
Log:
[pct] Fix some NQP in the comments, to make it actually work, if needed. So, no
changes are made to executable code, only to the NQP in the comments that is
implemented in PIR. This as a preparation of a possible bootstrap of NQP.
Modified: trunk/compilers/nqp/src/Grammar/Actions.pir
==============================================================================
--- trunk/compilers/nqp/src/Grammar/Actions.pir (original)
+++ trunk/compilers/nqp/src/Grammar/Actions.pir Tue Mar 25 08:45:07 2008
@@ -109,10 +109,10 @@
## $?BLOCK := PAST::Block.new( PAST::Stmts.new(),
## :blocktype('immediate'),
## :node($/) );
-## unshift @?BLOCK, $?BLOCK;
+## @?BLOCK.unshift($?BLOCK);
## }
## else {
-## my $past := shift @?BLOCK;
+## my $past := @?BLOCK.shift();
## $?BLOCK := @?BLOCK[0];
## $past.push($($<statement_list>));
## make $past;
@@ -145,7 +145,7 @@
## method statement_list($/) {
-## my $past := PAST::Stmts.new(node=>$/)
+## my $past := PAST::Stmts.new(:node($/))
## for $<statement> {
## $past.push($($_));
## }
@@ -313,14 +313,14 @@
## method for_statement($/) {
## my $block := $<block>;
-## $block.blocktype('sub');
-## $block.symbol('$_', scope => 'lexical');
-## my $topic_var := PAST::Var.new(name => '$_', scope => 'parameter');
+## $block.blocktype('immediate');
+## $block.symbol('$_', :scope('lexical'));
+## my $topic_var := PAST::Var.new( :name('$_'), :scope('parameter') );
## push @($block[0]), $topic_var;
## my $past := PAST::Op.new($($<EXPR>),
## $($<block>),
-## pasttype => $<sym>,
-## node => $/);
+## :pasttype(~$<sym>),
+## :node($/) );
## make $past;
.sub 'for_statement' :method
.param pmc match
@@ -393,7 +393,7 @@
.end
-## method block($/, $key) {
+## method block($/) {
## make $($<statement_block>);
## }
.sub 'block' :method
@@ -845,7 +845,7 @@
## my $name := $past.name();
## our $?BLOCK;
## unless $?BLOCK.symbol($name) {
-## $past.'isdecl'(1);
+## $past.isdecl(1);
## my $scope := ($<declarator> eq 'my') ? 'lexical' : 'package';
## $?BLOCK.symbol($name, :scope($scope));
## }
@@ -877,13 +877,13 @@
## method variable($/, $key) {
## if ($key eq '$< >') {
## make PAST::Var.new(
-## PAST::Var.new(scope=>'lexical', name=>'$/'),
-## PAST::Val.new(value=>~$[0]),
+## PAST::Var.new(:scope('lexical'), :name('$/') ),
+## PAST::Val.new(:value(~$/[0])),
## :scope('keyed'),
## :viviself('Undef') );
## }
## else {
-## make PAST::Var.new(node=>$/, name=>~$/)
+## make PAST::Var.new( :node($/), :name(~$/) )
## }
## }
.sub 'variable' :method
@@ -930,7 +930,7 @@
## method quote($/, $key) {
-## make PAST::Val.new(node=>$/, value=>~($<string_literal>))
+## make PAST::Val.new( :node($/), :value(~($<string_literal>)) );
## }
.sub 'quote' :method
.param pmc match
@@ -968,7 +968,7 @@
## method number($/, $key?) {
-## make PAST::Val.new(node=>$/, name=>~$/, vtype=>"Integer");
+## make PAST::Val.new( :node($/), :name(~$/), :returns("Integer") );
## }
.sub 'number' :method
.param pmc match
@@ -1005,7 +1005,7 @@
#### Expressions and operators ####
## method EXPR($/, $key) {
-## if ($key eq 'end') { make $($<expr>); return; }
+## if ($key eq 'end') { make $($<expr>); }
## my $past := PAST::Op.new( :node($/),
## :name($<type>),
## :pasttype($<top><pasttype>),