FIR/UAST: commonize loop/break/continue expressions

This commit is contained in:
Jinseong Jeon
2021-05-26 23:25:02 -07:00
committed by Ilya Kirillov
parent 1146f60db3
commit 50f750187b
20 changed files with 169 additions and 133 deletions
@@ -0,0 +1,6 @@
fun test() {
var x : String? = null
do {
x = "non-null"
} while (x != null)
}
@@ -0,0 +1,15 @@
UFile (package = )
UClass (name = DoWhileKt)
UMethod (name = test)
UBlockExpression
UDeclarationsExpression
ULocalVariable (name = x)
ULiteralExpression (value = null)
UDoWhileExpression
UBinaryExpression (operator = !=)
USimpleNameReferenceExpression (identifier = x)
ULiteralExpression (value = null)
UBlockExpression
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = x)
ULiteralExpression (value = "non-null")
@@ -0,0 +1,9 @@
UFile (package = )
UClass (name = DoWhileKt)
UMethod (name = test)
UBlockExpression
[!] UnknownKotlinExpression (PROPERTY)
UDoWhileExpression
[!] UnknownKotlinExpression (BINARY_EXPRESSION)
UBlockExpression
[!] UnknownKotlinExpression (BINARY_EXPRESSION)
@@ -0,0 +1,9 @@
public final class DoWhileKt {
public static final fun test() : void {
var x: java.lang.String = null
do {
x = "non-null"
}while (x != null)
}
}
@@ -0,0 +1,9 @@
public final class DoWhileKt {
public static final fun test() : void {
[!] UnknownKotlinExpression (PROPERTY)
do {
[!] UnknownKotlinExpression (BINARY_EXPRESSION)
}while ([!] UnknownKotlinExpression (BINARY_EXPRESSION))
}
}