FIR/UAST: commonize labeled expression
This commit is contained in:
committed by
Ilya Kirillov
parent
6e1b04e4c9
commit
c089b8ed04
@@ -4,3 +4,15 @@ fun test() {
|
||||
x = "non-null"
|
||||
} while (x != null)
|
||||
}
|
||||
|
||||
fun kt44412() {
|
||||
var i = 0
|
||||
Outer@while (true) {
|
||||
++i
|
||||
var j = 0
|
||||
Inner@do {
|
||||
++j
|
||||
} while (if (j >= 3) false else break) // break@Inner
|
||||
if (i == 3) break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,3 +13,33 @@ UFile (package = )
|
||||
UBinaryExpression (operator = =)
|
||||
USimpleNameReferenceExpression (identifier = x)
|
||||
ULiteralExpression (value = "non-null")
|
||||
UMethod (name = kt44412)
|
||||
UBlockExpression
|
||||
UDeclarationsExpression
|
||||
ULocalVariable (name = i)
|
||||
ULiteralExpression (value = 0)
|
||||
ULabeledExpression (label = Outer)
|
||||
UWhileExpression
|
||||
ULiteralExpression (value = true)
|
||||
UBlockExpression
|
||||
UPrefixExpression (operator = ++)
|
||||
USimpleNameReferenceExpression (identifier = i)
|
||||
UDeclarationsExpression
|
||||
ULocalVariable (name = j)
|
||||
ULiteralExpression (value = 0)
|
||||
ULabeledExpression (label = Inner)
|
||||
UDoWhileExpression
|
||||
UIfExpression
|
||||
UBinaryExpression (operator = >=)
|
||||
USimpleNameReferenceExpression (identifier = j)
|
||||
ULiteralExpression (value = 3)
|
||||
ULiteralExpression (value = false)
|
||||
UBreakExpression (label = null)
|
||||
UBlockExpression
|
||||
UPrefixExpression (operator = ++)
|
||||
USimpleNameReferenceExpression (identifier = j)
|
||||
UIfExpression
|
||||
UBinaryExpression (operator = ==)
|
||||
USimpleNameReferenceExpression (identifier = i)
|
||||
ULiteralExpression (value = 3)
|
||||
UBreakExpression (label = null)
|
||||
|
||||
@@ -7,3 +7,23 @@ UFile (package = )
|
||||
[!] UnknownKotlinExpression (BINARY_EXPRESSION)
|
||||
UBlockExpression
|
||||
[!] UnknownKotlinExpression (BINARY_EXPRESSION)
|
||||
UMethod (name = kt44412)
|
||||
UBlockExpression
|
||||
[!] UnknownKotlinExpression (PROPERTY)
|
||||
ULabeledExpression (label = Outer)
|
||||
UWhileExpression
|
||||
ULiteralExpression (value = "not-yet-compile-time-constant")
|
||||
UBlockExpression
|
||||
[!] UnknownKotlinExpression (PREFIX_EXPRESSION)
|
||||
[!] UnknownKotlinExpression (PROPERTY)
|
||||
ULabeledExpression (label = Inner)
|
||||
UDoWhileExpression
|
||||
UIfExpression
|
||||
[!] UnknownKotlinExpression (BINARY_EXPRESSION)
|
||||
ULiteralExpression (value = "not-yet-compile-time-constant")
|
||||
UBreakExpression (label = null)
|
||||
UBlockExpression
|
||||
[!] UnknownKotlinExpression (PREFIX_EXPRESSION)
|
||||
UIfExpression
|
||||
[!] UnknownKotlinExpression (BINARY_EXPRESSION)
|
||||
UBreakExpression (label = null)
|
||||
|
||||
@@ -6,4 +6,16 @@ public final class DoWhileKt {
|
||||
}while (x != null)
|
||||
|
||||
}
|
||||
public static final fun kt44412() : void {
|
||||
var i: int = 0
|
||||
Outer@ while (true) {
|
||||
++i
|
||||
var j: int = 0
|
||||
Inner@ do {
|
||||
++j
|
||||
}while (if (j >= 3) false else break)
|
||||
|
||||
if (i == 3) break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,16 @@ public final class DoWhileKt {
|
||||
}while ([!] UnknownKotlinExpression (BINARY_EXPRESSION))
|
||||
|
||||
}
|
||||
public static final fun kt44412() : void {
|
||||
[!] UnknownKotlinExpression (PROPERTY)
|
||||
Outer@ while ("not-yet-compile-time-constant") {
|
||||
[!] UnknownKotlinExpression (PREFIX_EXPRESSION)
|
||||
[!] UnknownKotlinExpression (PROPERTY)
|
||||
Inner@ do {
|
||||
[!] UnknownKotlinExpression (PREFIX_EXPRESSION)
|
||||
}while (if ([!] UnknownKotlinExpression (BINARY_EXPRESSION)) "not-yet-compile-time-constant" else break)
|
||||
|
||||
if ([!] UnknownKotlinExpression (BINARY_EXPRESSION)) break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user