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

[svn:parrot] r34954 - in branches/rvar/languages/perl6/src: classes parser

From:
pmichaud
Date:
January 4, 2009 20:27
Subject:
[svn:parrot] r34954 - in branches/rvar/languages/perl6/src: classes parser
Message ID:
20090105042736.C630DCB9F9@x12.develooper.com
Author: pmichaud
Date: Sun Jan  4 20:27:36 2009
New Revision: 34954

Modified:
   branches/rvar/languages/perl6/src/classes/Object.pir
   branches/rvar/languages/perl6/src/parser/actions.pm

Log:
[rakudo]:  Add simple type constraints to attributes.


Modified: branches/rvar/languages/perl6/src/classes/Object.pir
==============================================================================
--- branches/rvar/languages/perl6/src/classes/Object.pir	(original)
+++ branches/rvar/languages/perl6/src/classes/Object.pir	Sun Jan  4 20:27:36 2009
@@ -305,6 +305,8 @@
     .local pmc attr
     attr = new itypeclass
     setattribute candidate, parrotclass, attrname, attr
+    $P0 = attrhash['type']
+    setprop attr, 'type', $P0
     .local string keyname
     $I0 = index attrname, '!'
     if $I0 < 0 goto attrinit_loop

Modified: branches/rvar/languages/perl6/src/parser/actions.pm
==============================================================================
--- branches/rvar/languages/perl6/src/parser/actions.pm	(original)
+++ branches/rvar/languages/perl6/src/parser/actions.pm	Sun Jan  4 20:27:36 2009
@@ -1513,8 +1513,7 @@
             for @($<fulltypename>) {
                 $type.push( $( $_ ) );
             }
-            ## XXX: might need to revisit this, puts node in tree twice
-            $past.viviself( $( $<fulltypename>[0] ) );
+            $past.viviself( $( $<fulltypename>[0] ).clone() );
         }
     }
     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