correct continue in if handling,

move continue down if possible (invert expression of if when needed)
This commit is contained in:
Jindra Petřík
2021-01-29 20:14:32 +01:00
parent bc6e8770c1
commit f738e3b22b
6 changed files with 115 additions and 100 deletions

View File

@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash;
import com.jpexs.decompiler.flash.action.Action;
@@ -603,13 +604,12 @@ public class ActionScript2Test extends ActionScript2TestBase {
+ "{\r\n"
+ "a++;\r\n"
+ "b = b + 2;\r\n"
+ "b = b + 2;\r\n"
+ "if(c >= 10)\r\n"
+ "{\r\n"
+ "break;\r\n"
+ "}\r\n"
+ "trace(c);\r\n"
+ "c++;\r\n"
+ "c++;\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "}\r\n"
+ "trace(\"konec\");\r\n"
);
@@ -676,13 +676,12 @@ public class ActionScript2Test extends ActionScript2TestBase {
+ "while(true)\r\n"
+ "{\r\n"
+ "k++;\r\n"
+ "k++;\r\n"
+ "if(k >= 10)\r\n"
+ "{\r\n"
+ "break;\r\n"
+ "}\r\n"
+ "k = k * 5;\r\n"
+ "trace(k);\r\n"
+ "trace(k);\r\n"
+ "continue;\r\n"
+ "}\r\n"
+ "}\r\n"
+ "trace(\"end\");\r\n"
);