develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34433 - trunk/languages/pipp/src/pct

From:
bernhard
Date:
December 27, 2008 09:52
Subject:
[svn:parrot] r34433 - trunk/languages/pipp/src/pct
Message ID:
20081227175241.A56D2CBA12@x12.develooper.com
Author: bernhard
Date: Sat Dec 27 09:52:40 2008
New Revision: 34433

Modified:
   trunk/languages/pipp/src/pct/actions.pm
   trunk/languages/pipp/src/pct/grammar.pg

Log:
[Pipp] Rename array_arguments to array_argument.
Simplify instantiate_array.


Modified: trunk/languages/pipp/src/pct/actions.pm
==============================================================================
--- trunk/languages/pipp/src/pct/actions.pm	(original)
+++ trunk/languages/pipp/src/pct/actions.pm	Sat Dec 27 09:52:40 2008
@@ -182,14 +182,14 @@
                 #for $<key_value_pair> {
                 #$past.push( $($_) );
                 #}
-    for $<array_arguments> {
+    for $<array_argument> {
         $past.push( $($_) );
     }   
 
     make $past;
 }
 
-method array_arguments($/, $key) {
+method array_argument($/, $key) {
     make $( $/{$key} );
 }
 

Modified: trunk/languages/pipp/src/pct/grammar.pg
==============================================================================
--- trunk/languages/pipp/src/pct/grammar.pg	(original)
+++ trunk/languages/pipp/src/pct/grammar.pg	Sat Dec 27 09:52:40 2008
@@ -183,8 +183,8 @@
 
 rule if_statement {
     'if' <conditional_expression>
-    [<elseif_clause>]*
-    [<else_clause>]?
+    <elseif_clause>*
+    <else_clause>?
     {*}
 }
 
@@ -273,12 +273,13 @@
     {*}
 }
 
+# a trailing ',' is allowed
 rule instantiate_array {
-    'array' '(' [ <array_arguments> [  [',' <array_arguments> ]* [',' <array_arguments> ]?  ]? ','?  ]?  ')'
+    'array' '(' [ <array_argument> [ ',' <array_argument> ]* ]? ','? ')'
     {*}
 }
 
-rule array_arguments {
+rule array_argument {
     | <key_value_pair>  {*}    #= key_value_pair
     | <expression>      {*}    #= expression
 }



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About