[svn:parrot] r37790 - in branches/pge1/compilers/nqp: src/Grammar t

pmichaud at svn.parrot.org pmichaud at svn.parrot.org
Sat Mar 28 01:17:12 UTC 2009


Author: pmichaud
Date: Sat Mar 28 01:17:12 2009
New Revision: 37790
URL: https://trac.parrot.org/parrot/changeset/37790

Log:
[nqp]:  Switch 'item' calls to 'ast'.

Modified:
   branches/pge1/compilers/nqp/src/Grammar/Actions.pir
   branches/pge1/compilers/nqp/t/24-scalar_context.t

Modified: branches/pge1/compilers/nqp/src/Grammar/Actions.pir
==============================================================================
--- branches/pge1/compilers/nqp/src/Grammar/Actions.pir	Sat Mar 28 01:16:55 2009	(r37789)
+++ branches/pge1/compilers/nqp/src/Grammar/Actions.pir	Sat Mar 28 01:17:12 2009	(r37790)
@@ -40,7 +40,7 @@
     .param pmc match
     .local pmc past
     $P0 = match['statement_block']
-    past = $P0.'item'()
+    past = $P0.'ast'()
     past.'blocktype'('declaration')
     match.'!make'(past)
 .end
@@ -83,7 +83,7 @@
     $P1 = $P0[0]
     set_global '$?BLOCK', $P1
     $P2 = match['statement_list']
-    $P3 = $P2.'item'()
+    $P3 = $P2.'ast'()
     past.'push'($P3)
     match.'!make'(past)
 .end
@@ -108,7 +108,7 @@
   iter_loop:
     unless iter goto iter_end
     $P2 = shift iter
-    $P2 = $P2.'item'()
+    $P2 = $P2.'ast'()
     past.'push'($P2)
     goto iter_loop
   iter_end:
@@ -123,7 +123,7 @@
     .param pmc match
     .param string key
     $P0 = match[key]
-    $P1 = $P0.'item'()
+    $P1 = $P0.'ast'()
     match.'!make'($P1)
 .end
 
@@ -163,7 +163,7 @@
     unless $I0 goto while
     block = match['else']
     block = block[0]
-    block = block.'item'()
+    block = block.'ast'()
     past.'push'( block )
 
   while:
@@ -180,12 +180,12 @@
   get_expr:
     expr = match['EXPR']
     expr = expr[cond]
-    expr = expr.'item'()
+    expr = expr.'ast'()
     ret
   get_block:
     block = match['block']
     block = block[cond]
-    block = block.'item'()
+    block = block.'ast'()
     ret
   end:
     match.'!make'(past)
@@ -205,10 +205,10 @@
     .local pmc expr, block, past
     expr = match['EXPR']
     expr = expr
-    expr = expr.'item'()
+    expr = expr.'ast'()
     block = match['block']
     block = block
-    block = block.'item'()
+    block = block.'ast'()
     $P0 = get_hll_global ['PAST'], 'Op'
     past = $P0.'new'(expr, block, 'pasttype'=>'unless', 'node'=>match)
     match.'!make'(past)
@@ -225,9 +225,9 @@
 .sub 'repeat_statement' :method
     .param pmc match
     $P1 = match['EXPR']
-    $P1 = $P1.'item'()
+    $P1 = $P1.'ast'()
     $P2 = match['block']
-    $P2 = $P2.'item'()
+    $P2 = $P2.'ast'()
     $S0 = match['sym']
     $S0 = concat 'repeat_', $S0
     $P0 = get_hll_global ['PAST'], 'Op'
@@ -246,9 +246,9 @@
 .sub 'while_statement' :method
     .param pmc match
     $P1 = match['EXPR']
-    $P1 = $P1.'item'()
+    $P1 = $P1.'ast'()
     $P2 = match['block']
-    $P2 = $P2.'item'()
+    $P2 = $P2.'ast'()
     $S0 = match['sym']
     $P0 = get_hll_global ['PAST'], 'Op'
     $P5 = $P0.'new'( $P1, $P2, 'pasttype'=>$S0, 'node'=>match)
@@ -271,9 +271,9 @@
     .param pmc match
     .local pmc block, past
     $P0  = match['EXPR']
-    $P0  = $P0.'item'()
+    $P0  = $P0.'ast'()
     $P1  = match['block']
-    block = $P1.'item'()
+    block = $P1.'ast'()
     block.'blocktype'('immediate')
     .local pmc params, topic_var
     params = block[0]
@@ -297,7 +297,7 @@
 .sub 'return_statement' :method
     .param pmc match
     $P0 = match['EXPR']
-    $P0 = $P0.'item'()
+    $P0 = $P0.'ast'()
 
     $P1 = get_hll_global ['PAST'], 'Op'
     $P1 = $P1.'new'( $P0, 'pasttype'=>'return', 'node'=>match)
@@ -317,7 +317,7 @@
     $P0 = get_hll_global ['PAST'], 'Var'
     $P1 = $P0.'new'( 'name'=>'$/', 'scope'=>'lexical' )
     $P2 = match['EXPR']
-    $P3 = $P2.'item'()
+    $P3 = $P2.'ast'()
     $P4 = get_hll_global ['PAST'], 'Op'
     $P5 = $P4.'new'($P1, $P3, 'name'=>'!make', 'pasttype'=>'callmethod')
     match.'!make'($P5)
@@ -341,7 +341,7 @@
     if key != 'quote' goto not_quote
     $P0 = match['quote']
     $P0 = $P0['string_literal']
-    inline = $P0.'item'()
+    inline = $P0.'ast'()
     goto make
   not_quote:
     if key != 'heredoc' goto not_heredoc
@@ -361,7 +361,7 @@
 .sub 'block' :method
     .param pmc match
     $P0 = match['statement_block']
-    $P0 = $P0.'item'()
+    $P0 = $P0.'ast'()
     match.'!make'($P0)
 .end
 
@@ -389,7 +389,7 @@
     .param pmc match
     .local pmc past
     $P0 = match['block']
-    past = $P0.'item'()
+    past = $P0.'ast'()
     $S0 = match['ident']
     past.'name'($S0)
     past.'node'(match)
@@ -412,7 +412,7 @@
     $P1 = shift iter
     .local pmc parameter
     $P2 = $P1['parameter']
-    parameter = $P2.'item'()
+    parameter = $P2.'ast'()
     $S0 = parameter.'name'()
     past.'symbol'($S0, 'scope'=>'lexical')
     params.'push'(parameter)
@@ -449,7 +449,7 @@
     .param pmc key
     .local pmc past, sigil
     past = match['param_var']
-    past = past.'item'()
+    past = past.'ast'()
     sigil = match['param_var';'sigil']
     if key != 'slurp' goto not_slurp
     if sigil != '@' goto not_slurpy_array
@@ -508,7 +508,7 @@
     .param pmc key
     .local pmc past
     $P0 = match['noun']
-    past = $P0.'item'()
+    past = $P0.'ast'()
     $P1 = match['postfix']
     if null $P1 goto end
     .local pmc iter, term
@@ -517,7 +517,7 @@
     unless iter goto end
     $P2 = shift iter
     term = past
-    past = $P2.'item'()
+    past = $P2.'ast'()
     past.'unshift'(term)
     goto iter_loop
   end:
@@ -532,7 +532,7 @@
     .param pmc match
     .param string key
     $P0 = match[key]
-    $P1 = $P0.'item'()
+    $P1 = $P0.'ast'()
     match.'!make'($P1)
 .end
 
@@ -549,7 +549,7 @@
     .param string key
     .local pmc past
     $P0 = match['arglist']
-    past = $P0.'item'()
+    past = $P0.'ast'()
     $S0 = match['ident']
     past.'name'($S0)
     past.'pasttype'('callmethod')
@@ -598,13 +598,13 @@
   keyed_hash:
     $P0 = get_hll_global ['PAST'], 'Var'
     $P1 = match['EXPR']
-    $P2 = $P1.'item'()
+    $P2 = $P1.'ast'()
     $P3 = $P0.'new'( $P2, 'scope'=>scope, 'vivibase'=>vivibase, 'viviself'=>'Undef', 'node'=>match )
     match.'!make'($P3)
     .return ()
   subcall:
     $P0 = match['arglist']
-    past = $P0.'item'()
+    past = $P0.'ast'()
     past.'pasttype'('call')
     past.'node'(match)
     match.'!make'(past)
@@ -612,7 +612,7 @@
   keyed_const:
     $P0 = get_hll_global ['PAST'], 'Val'
     $P1 = match['string_literal']
-    $P2 = $P1.'item'()
+    $P2 = $P1.'ast'()
     .local pmc value
     value = $P0.'new'( 'value' => $P2, 'node'=> $P1 )
     $P0 = get_hll_global ['PAST'], 'Var'
@@ -631,7 +631,7 @@
 ##    }
 ##    if $key eq '$( )' {
 ##        make PAST::Op.new( $expr,
-##                           :name('item'),
+##                           :name('ast'),
 ##                           :pasttype('callmethod'),
 ##                           :node($/) );
 ##    }
@@ -648,7 +648,7 @@
   have_expr:
     $P1 = $P0[0]
   get_past:
-    $P1 = $P1.'item'()
+    $P1 = $P1.'ast'()
     $P0 = get_hll_global ['PAST'], 'Op'
     if key == '@( )' goto list_context
     if key == '$( )' goto scalar_context
@@ -660,7 +660,7 @@
     match.'!make'(past)
     .return ()
   scalar_context:
-    past = $P0.'new'($P1, 'name' => 'item', 'pasttype'=>'callmethod', 'node'=>match)
+    past = $P0.'new'($P1, 'name' => 'ast', 'pasttype'=>'callmethod', 'node'=>match)
     match.'!make'(past)
 .end
 
@@ -697,7 +697,7 @@
     if null $P1 goto end
     .local pmc expr, iter
     $P2 = $P1[0]
-    expr = $P2.'item'()
+    expr = $P2.'ast'()
     $S0 = expr.'name'()
     if $S0 != 'infix:,' goto one_arg
   comma_arg:
@@ -736,7 +736,7 @@
     .param pmc match
     .param pmc key
     $P0 = match[key]
-    $P1 = $P0.'item'()
+    $P1 = $P0.'ast'()
     match.'!make'($P1)
 .end
 
@@ -757,7 +757,7 @@
     $P9 = get_hll_global ['PAST'], 'Val'
     $P1 = $P9.'new'('value'=>$S0, 'node'=>$P0)
     $P2 = match['EXPR']
-    $P2 = $P2.'item'()
+    $P2 = $P2.'ast'()
     $P9 = get_hll_global ['PAST'], 'Op'
     $P3 = $P9.'new'($P1, $P2, 'name'=>'infix:=>', 'returns'=>'Pair', 'node'=>match)
     match.'!make'($P3)
@@ -777,7 +777,7 @@
     .param pmc key
     .local pmc past
     $P0 = match[key]
-    past = $P0.'item'()
+    past = $P0.'ast'()
     $P1 = match['name']
     $P1 = $P1['ident']
     past.'namespace'($P1)
@@ -823,7 +823,7 @@
     .local pmc past, block
     .local string name
     $P0 = match['variable']
-    past = $P0.'item'()
+    past = $P0.'ast'()
     name = past.'name'()
     block = get_global '$?BLOCK'
     $P0 = block.'symbol'(name)
@@ -891,7 +891,7 @@
     .param pmc match
     .param pmc key
     $P0 = match[key]
-    $P1 = $P0.'item'()
+    $P1 = $P0.'ast'()
     match.'!make'($P1)
 .end
 
@@ -904,7 +904,7 @@
     .param pmc key             :optional
     .local string value
     $P0 = match['string_literal']
-    value = $P0.'item'()
+    value = $P0.'ast'()
     $P0 = get_hll_global ['PAST'], 'Val'
     $P1 = $P0.'new'('node'=>match, 'value'=>value)
     match.'!make'($P1)
@@ -960,7 +960,7 @@
     .param pmc key             :optional
     .local pmc past
     $P0 = match['arglist']
-    past = $P0.'item'()
+    past = $P0.'ast'()
     $S0 = match['ident']
     past.'name'($S0)
     past.'pasttype'('call')
@@ -988,7 +988,7 @@
     if key != 'end' goto expr_reduce
   expr_end:
     $P0 = match['expr']
-    $P1 = $P0.'item'()
+    $P1 = $P0.'ast'()
     match.'!make'($P1)
     .return ()
   expr_reduce:
@@ -1008,7 +1008,7 @@
     $I0 = $P2.'from'()
     $I1 = $P2.'to'()
     if $I0 == $I1 goto iter_loop
-    $P2 = $P2.'item'()
+    $P2 = $P2.'ast'()
     past.'push'($P2)
     goto iter_loop
   iter_end:

Modified: branches/pge1/compilers/nqp/t/24-scalar_context.t
==============================================================================
--- branches/pge1/compilers/nqp/t/24-scalar_context.t	Sat Mar 28 01:16:55 2009	(r37789)
+++ branches/pge1/compilers/nqp/t/24-scalar_context.t	Sat Mar 28 01:17:12 2009	(r37790)
@@ -5,7 +5,7 @@
 plan(1);
 
 class XYZ {
-    method item() {
+    method ast() {
         'ok 1';
     }
 }


More information about the parrot-commits mailing list