Fixed goto/for detection

This commit is contained in:
Jindra Petřík
2021-01-23 12:55:13 +01:00
parent c5f992b675
commit 3f2e075ee9
8 changed files with 220 additions and 30 deletions

View File

@@ -0,0 +1,35 @@
package tests
{
public class TestGotos6
{
public function run():void
{
var a:Boolean = true;
var s:String = "a";
if (a)
{
switch (s)
{
case "a":
trace("is A");
break;
case "b":
trace("is B");
case "c":
trace("is BC");
break;
}
}
else
{
trace("D");
}
trace("finish");
}
}
}

View File

@@ -0,0 +1,38 @@
package tests
{
public class TestGotos7
{
public function run():void
{
for (var i:int = 0; i < 10; i++)
{
switch (i)
{
case 0:
trace("zero");
continue;
case 5:
trace("five");
break;
case 10:
trace("ten");
break;
case 1:
if (i == 7)
{
continue;
}
trace("one");
default:
trace("def");
}
trace("before loop end");
}
}
}
}