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

[svn:parrot] r33964 - branches/rakudoreg/languages/perl6/src/parser

From:
jonathan
Date:
December 16, 2008 09:34
Subject:
[svn:parrot] r33964 - branches/rakudoreg/languages/perl6/src/parser
Message ID:
20081216173418.C6C02CBA12@x12.develooper.com
Author: jonathan
Date: Tue Dec 16 09:34:17 2008
New Revision: 33964

Modified:
   branches/rakudoreg/languages/perl6/src/parser/actions.pm

Log:
[rakudo] Fix type capture more properly; the spec test passes again.

Modified: branches/rakudoreg/languages/perl6/src/parser/actions.pm
==============================================================================
--- branches/rakudoreg/languages/perl6/src/parser/actions.pm	(original)
+++ branches/rakudoreg/languages/perl6/src/parser/actions.pm	Tue Dec 16 09:34:17 2008
@@ -1312,7 +1312,6 @@
                             )
                         )
                     ));
-                    $block_past.symbol($tvname, :scope('lexical'), :does_abstraction(1));
                 }
                 else {
                     my $type_obj := make_anon_subset($( $_<EXPR> ), $parameter);
@@ -1449,6 +1448,18 @@
         }
         $past.viviself( $( $<default_value>[0]<EXPR> ) );
     }
+
+    # If it's a type variable, we should register it in the block now as we
+    # may see it again later in the signature.
+    if $/<type_constraint> {
+        for $/<type_constraint> {
+            if substr($_<typename><name>, 0, 2) eq '::' {
+                our $?BLOCK;
+                $?BLOCK.symbol(substr($_<typename><name>, 2), :scope('lexical'), :does_abstraction(1));
+            }
+        }
+    }
+
     make $past;
 }
 



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