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

[svn:parrot] r34324 - trunk/languages/perl6/src/builtins

From:
pmichaud
Date:
December 24, 2008 01:53
Subject:
[svn:parrot] r34324 - trunk/languages/perl6/src/builtins
Message ID:
20081224095256.30ECCCBA12@x12.develooper.com
Author: pmichaud
Date: Wed Dec 24 01:52:55 2008
New Revision: 34324

Modified:
   trunk/languages/perl6/src/builtins/any-str.pir

Log:
[rakudo]:  Clean up some bugs in .subst reported by skids1++ .
There's still a lot more that needs fixing here, though.


Modified: trunk/languages/perl6/src/builtins/any-str.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/any-str.pir	(original)
+++ trunk/languages/perl6/src/builtins/any-str.pir	Wed Dec 24 01:52:55 2008
@@ -313,7 +313,7 @@
 .sub 'match' :method :multi(_)
     .param pmc x
     .local pmc match
-    match = x(self, 'grammar'=>'Match')
+    match = x.'!invoke'(self)
     .return(match)
 .end
 
@@ -326,6 +326,7 @@
     .param pmc values          :slurpy
     $I0 = elements values
     unless $I0 == 1 goto reverse_list
+    $P0 = values[0]
     .tailcall $P0.'reverse'()
   reverse_list:
     values.'!flatten'()
@@ -1028,9 +1029,9 @@
     nth_opt = get_hll_global ['Bool'], 'True'
 
   build_matches:
-    .local string result
-    result = self
-    result = clone result
+    .local string source, result
+    source = self
+    result = clone source
 
     if times == 0 goto subst_done
 
@@ -1040,7 +1041,7 @@
     n_cnt = 0
     x_cnt = 0
     matchlist = new 'ResizablePMCArray'
-    match = regex(result)
+    match = regex.'!invoke'(source)
     unless match goto matchlist_done
 
   matchlist_loop:
@@ -1082,8 +1083,7 @@
     replacestr = replacement
     goto have_replacestr
   replacement_sub:
-    $S0 = match
-    replacestr = replacement($S0)
+    replacestr = replacement(match)
   have_replacestr:
     # perform the replacement
     $I0 = match.'from'()



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