gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/avm2 r9592: Improve conversion of calls to


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9592: Improve conversion of calls to String.split() and String.indexOf()
Date: Wed, 08 Oct 2008 14:04:16 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9592
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Wed 2008-10-08 14:04:16 +0800
message:
  Improve conversion of calls to String.split() and String.indexOf()
modified:
  testsuite/actionscript.all/haxe-swf9/as_to_hx.pl
=== modified file 'testsuite/actionscript.all/haxe-swf9/as_to_hx.pl'
--- a/testsuite/actionscript.all/haxe-swf9/as_to_hx.pl  2008-10-08 05:14:54 
+0000
+++ b/testsuite/actionscript.all/haxe-swf9/as_to_hx.pl  2008-10-08 06:04:16 
+0000
@@ -155,16 +155,10 @@
                $_ =~ s/(\w+\.split\(\s*undefined\s*),.+(\))/$1$2/g;
 
                #CHECK 5.3
-               #Replace calls to split(a,b) with split(a).slice(0,a)
-               $_ =~ s/(\w+\.split\(.+),\s*(\w+)\s*(\))/$1$3.slice(0,$2)/g;
+               #Replace calls to str.split(a,b) with 
a==""?[]:str==""?[""]:str.split(a).slice(0,b)
+               #                str                    a               b
+               $_ =~ 
s/(\w+)\.split\((.+),\s*(\w+)\s*\)/$2==""?[]:$1==""?[""]:$1.split($2).slice(0,$3)/g;
                
-               #CHECK 5.4 - Must run after CHECK 4
-               #Remove calls to split that have more than one argument.
-               if($_ =~ /\.split\(\s*\w+\s*,\s*\w+\s*\)/){
-                       skip_line();
-                       next;
-               }
-
        }
        if(index($_,"length") != $[-1){
                #Remove attemps to set strings length property.  Haxe compliler 
does not allow this.
@@ -193,7 +187,8 @@
                skip_line();
                next;
        }
-       if($_ =~ /indexOf/){
+       #Remove calls to String.indexOf that have more than one argument
+       if($_ =~ /indexOf\(\s*[\"\w]\w*[\"\w],.+\)/){
                skip_line();
                next;
        }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]