develooper Front page | perl.cvs.parrot | Postings from January 2009

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

From:
bernhard
Date:
January 23, 2009 06:31
Subject:
[svn:parrot] r35912 - trunk/languages/pipp/src/pct
Message ID:
20090123143125.674B0CB9AE@x12.develooper.com
Author: bernhard
Date: Fri Jan 23 06:31:21 2009
New Revision: 35912

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

Log:
[Pipp] '_hidden' is used after all, in 'use' declarations

Modified: trunk/languages/pipp/src/pct/actions.pm
==============================================================================
--- trunk/languages/pipp/src/pct/actions.pm	(original)
+++ trunk/languages/pipp/src/pct/actions.pm	Fri Jan 23 06:31:21 2009
@@ -329,10 +329,19 @@
 }
 
 method global_declaration($/) {
-    # for now just a placeholder
-    my $past := PAST::Stmts.new( :name('global_definition') );
 
-    make $past;
+    # variables are 'lexical' in the current block,
+    # unless they are found in the symbol table of the current block
+    our @?BLOCK;
+    unless ( @?BLOCK[0].symbol( ~$<var_name> ) ) {
+        @?BLOCK[0].symbol(
+            ~$<var_name>, :comment('global_declaration')
+        );
+    }
+
+    make PAST::Stmts.new(
+        :name("global_definition of $<var_name>")
+    );
 }
 
 method argument_list($/) {
@@ -446,7 +455,8 @@
     # variables are 'lexical' in the current block,
     # unless they are found in the symbol table of the current block
     our @?BLOCK;
-    unless ( @?BLOCK[0].symbol( ~$<var_name> ) ) {
+    unless (   @?BLOCK[0].symbol( ~$<var_name> ) 
+            || @?BLOCK[0].symbol( ~$<var_name> ~ '_hidden' )) {
         @?BLOCK[0].symbol(
             :scope('lexical'),
             ~$<var_name>



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