[FIR] Create additional nodes to replace operator call in some places
1. FirAssignmentOperatorStatement - represent assignment operations such as =, +=, -=, /=, %= 2. FirEqualityOperatorCall - represent boolean operations such as ==, !=, ===, !== #KT-38333 In Progress
This commit is contained in:
+2
@@ -86,6 +86,8 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
||||
val operatorCall = element("OperatorCall", Expression, expression, call)
|
||||
val comparisonExpression = element("ComparisonExpression", Expression, expression)
|
||||
val typeOperatorCall = element("TypeOperatorCall", Expression, expression, call)
|
||||
val assignmentOperatorStatement = element("AssignmentOperatorStatement", Expression, statement)
|
||||
val equalityOperatorCall = element("EqualityOperatorCall", Expression, expression, call)
|
||||
val whenExpression = element("WhenExpression", Expression, expression, resolvable)
|
||||
val whenBranch = element("WhenBranch", Expression)
|
||||
val qualifiedAccessWithoutCallee = element("QualifiedAccessWithoutCallee", Expression, statement)
|
||||
|
||||
+9
-9
@@ -226,15 +226,8 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
}
|
||||
|
||||
impl(operatorCall) {
|
||||
default("typeRef", """
|
||||
|if (operation in FirOperation.BOOLEANS) {
|
||||
| FirImplicitBooleanTypeRef(null)
|
||||
| } else {
|
||||
| FirImplicitTypeRefImpl(null)
|
||||
| }
|
||||
""".trimMargin())
|
||||
|
||||
useTypes(implicitTypeRefType, implicitBooleanTypeRefType)
|
||||
default("typeRef", "FirImplicitTypeRefImpl(null)")
|
||||
useTypes(implicitTypeRefType)
|
||||
}
|
||||
|
||||
impl(comparisonExpression) {
|
||||
@@ -244,6 +237,13 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
|
||||
impl(typeOperatorCall)
|
||||
|
||||
impl(assignmentOperatorStatement)
|
||||
|
||||
impl(equalityOperatorCall) {
|
||||
default("typeRef", "FirImplicitBooleanTypeRef(null)")
|
||||
useTypes(implicitBooleanTypeRefType)
|
||||
}
|
||||
|
||||
impl(resolvedQualifier) {
|
||||
isMutable("packageFqName", "relativeClassFqName", "isNullableLHSForCallableReference")
|
||||
default("classId") {
|
||||
|
||||
+10
@@ -222,6 +222,16 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
needTransformOtherChildren()
|
||||
}
|
||||
|
||||
assignmentOperatorStatement.configure {
|
||||
+field("operation", operationType)
|
||||
+field("leftArgument", expression).withTransform()
|
||||
+field("rightArgument", expression).withTransform()
|
||||
}
|
||||
|
||||
equalityOperatorCall.configure {
|
||||
+field("operation", operationType)
|
||||
}
|
||||
|
||||
whenBranch.configure {
|
||||
+field("condition", expression).withTransform()
|
||||
+field("result", block).withTransform()
|
||||
|
||||
Reference in New Issue
Block a user