Support 'break' and 'continue' in expressions

- generate fake jump instructions so that we can always analyze stack depths
- fix stack before break and continue by dropping excessive elements (e.g., *a*.foo(*b*, c?:continue))
- Analyzer rewritten in Kotlin, with more flexible control of CFG traversal

 #Fixed KT-3340
 #Fixed KT-4258
 #Fixed KT-7941
This commit is contained in:
dnpetrov
2015-06-23 12:13:48 +03:00
parent d937f385cd
commit c24e6b5698
21 changed files with 739 additions and 18 deletions
@@ -0,0 +1,14 @@
fun concatNonNulls(strings: List<String?>): String {
var result = ""
for (str in strings) {
result += str?:continue
}
return result
}
fun box(): String {
val test = concatNonNulls(listOf("abc", null, null, "", null, "def"))
if (test != "abcdef") return "Failed: test=$test"
return "OK"
}