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

[email protected]
Newsgroups perl.cvs.parrot
Message-ID <[email protected]>
Author: bernhard
Date: Sat Jan 17 06:46:17 2009
New Revision: 35686

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

Log:
[Pipp] only simple identifiers are allowed in constant definition

Modified: trunk/languages/pipp/src/pct/actions.pm
==============================================================================
--- trunk/languages/pipp/src/pct/actions.pm	(original)
+++ trunk/languages/pipp/src/pct/actions.pm	Sat Jan 17 06:46:17 2009
@@ -291,7 +291,7 @@
         PAST::Op.new(
             :pasttype('bind'),
             PAST::Var.new(
-                :name(~$<constant_name>),
+                :name(~$<ident>),
                 :isdecl(1),
                 :scope('package'),
                 :viviself('PhpNull'),
@@ -310,7 +310,7 @@
         PAST::Op.new(
             :pasttype('bind'),
             PAST::Var.new(
-                :name(~$<constant_name>),
+                :name(~$<ident>),
                 :isdecl(1),
                 :scope('package'),
                 :viviself('PhpNull'),

Modified: trunk/languages/pipp/src/pct/grammar.pg
==============================================================================
--- trunk/languages/pipp/src/pct/grammar.pg	(original)
+++ trunk/languages/pipp/src/pct/grammar.pg	Sat Jan 17 06:46:17 2009
@@ -266,7 +266,7 @@
     | <morename>+            # leading backslash
 }
 
-token morename { <.namespace_separator> <ident> }
+token morename                 { <.namespace_separator> <ident> }
 
 token var_name                 { '$' <ident> }
 
@@ -445,14 +445,14 @@
 }
 
 rule class_constant_definition {
-    'const' <constant_name> '=' <literal> <.statement_delimiter>
+    'const' <ident> '=' <literal> <.statement_delimiter>
     {*}
 }
 
 # In PHP 5.3 a constand definition outside a declared namespace is forbidden
 # In Pipp this is not checked
 rule namespace_constant_definition {
-    'const' <constant_name> '=' <literal> <.statement_delimiter>
+    'const' <ident> '=' <literal> <.statement_delimiter>
     {*}
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.