[svn:parrot] r46057 - trunk/t/compilers/pge/perl6regex

mikehh at svn.parrot.org mikehh at svn.parrot.org
Tue Apr 27 13:10:11 UTC 2010


Author: mikehh
Date: Tue Apr 27 13:10:11 2010
New Revision: 46057
URL: https://trac.parrot.org/parrot/changeset/46057

Log:
change in-place substr to replace

Modified:
   trunk/t/compilers/pge/perl6regex/01-regex.t

Modified: trunk/t/compilers/pge/perl6regex/01-regex.t
==============================================================================
--- trunk/t/compilers/pge/perl6regex/01-regex.t	Tue Apr 27 13:01:43 2010	(r46056)
+++ trunk/t/compilers/pge/perl6regex/01-regex.t	Tue Apr 27 13:10:11 2010	(r46057)
@@ -237,8 +237,8 @@
     # remove /'s
     $S0 = substr result, 0, 1
     if $S0 != "/" goto bad_line
-    substr result, 0, 1, ''
-    substr result, -1, 1, ''
+    result = replace result, 0, 1, ''
+    result = replace result, -1, 1, ''
 
     $I0 = index $S1, result
     if $I0 == -1 goto is_nok
@@ -281,8 +281,8 @@
     # remove /'s
     $S0 = substr result, 0, 1
     if $S0 != "/" goto bad_error
-    substr result, 0, 1, ''
-    substr result, -1, 1, ''
+    result = replace result, 0, 1, ''
+    result = replace result, -1, 1, ''
     $I0 = index message, result
     if $I0 == -1 goto bad_error
     ok = 1
@@ -442,27 +442,27 @@
   target1:
     $I0 = index target, '\n'
     if $I0 == -1 goto target2
-    substr target, $I0, 2, "\n"
+    target = replace target, $I0, 2, "\n"
     goto target1
   target2:
     $I0 = index target, '\r'
     if $I0 == -1 goto target3
-    substr target, $I0, 2, "\r"
+    target = replace target, $I0, 2, "\r"
     goto target2
   target3:
     $I0 = index target, '\e'
     if $I0 == -1 goto target4
-    substr target, $I0, 2, "\e"
+    target = replace target, $I0, 2, "\e"
     goto target3
   target4:
     $I0 = index target, '\t'
     if $I0 == -1 goto target5
-    substr target, $I0, 2, "\t"
+    target = replace target, $I0, 2, "\t"
     goto target4
   target5:
     $I0 = index target, '\f'
     if $I0 == -1 goto target6
-    substr target, $I0, 2, "\f"
+    target = replace target, $I0, 2, "\f"
     goto target5
   target6:
     # handle \xHH, hex escape.
@@ -475,7 +475,7 @@
     ($S0, $I2) = $P0(target, 'x', $I1)
     $S3 = substr target, $I1, $I2
     $I2 += 2
-    substr target, $I0, $I2, $S0
+    target = replace target, $I0, $I2, $S0
     goto target6
   target7:
     .return (target)


More information about the parrot-commits mailing list