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

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

From:
jonathan
Date:
January 6, 2009 10:45
Subject:
[svn:parrot] r35066 - in branches/rvar/languages/perl6/src: classes parser
Message ID:
20090106184515.5C12ACB9F9@x12.develooper.com
Author: jonathan
Date: Tue Jan  6 10:45:14 2009
New Revision: 35066

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

Log:
[rakudo] Change the way we set up multi_invocant. Also default type to Any if it's not set. This gets us through - though partly failing - S06-multi/syntax.t.

Modified: branches/rvar/languages/perl6/src/classes/Signature.pir
==============================================================================
--- branches/rvar/languages/perl6/src/classes/Signature.pir	(original)
+++ branches/rvar/languages/perl6/src/classes/Signature.pir	Tue Jan  6 10:45:14 2009
@@ -55,6 +55,21 @@
     .param pmc attr            :slurpy :named
 
     attr['name'] = varname
+
+    # If no multi_invocant value, set it to 1 (meaning it is one).
+    $I0 = exists attr['multi_invocant']
+    if $I0 goto have_mi
+    attr['multi_invocant'] = 1
+  have_mi:
+
+    # For now, if no type, set it to Any.
+    $I0 = exists attr['type']
+    if $I0 goto have_type
+    $P0 = get_hll_global 'Any'
+    attr['type'] = $P0
+  have_type:
+
+    # Add to parameters list.
     .local pmc params
     params = self.'params'()
     push params, attr

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	Tue Jan  6 10:45:14 2009
@@ -926,8 +926,8 @@
         ##  loop through parameters of signature
         my $arity := $<parameter> ?? +@($<parameter>) !! 0;
         $block.arity($arity);
-        my $i         := 0;
-        my $multi_inv := 1;
+        my $i                  := 0;
+        my $multi_inv_suppress := 0;
         while $i < $arity {
             my $var    := $( $<parameter>[$i] );
             my $name   := $var.name();
@@ -968,8 +968,10 @@
             }
             $sigparam.push(PAST::Val.new(:value($readtype),:named('readtype')));
 
-            $sigparam.push(PAST::Val.new(:value($multi_inv),:named('multi_invocant')));
-            if $<param_sep>[$i][0] eq ';;' { $multi_inv := 0; }
+            if ($multi_inv_suppress) {
+                $sigparam.push(PAST::Val.new(:value(0),:named('multi_invocant')));
+            }
+            if $<param_sep>[$i][0] eq ';;' { $multi_inv_suppress := 1; }
 
             $loadinit.push($sigparam);
             $i++;



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