[FIR][tree] introduce lazy expression to simplify code
^KT-56543
This commit is contained in:
committed by
Space Team
parent
bc5c1b2a6c
commit
a643dfbe83
+4
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -26,6 +26,7 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
||||
|
||||
val statement by element(Expression, annotationContainer)
|
||||
val expression by element(Expression, statement)
|
||||
val lazyExpression by element(Expression, expression)
|
||||
|
||||
val contextReceiver by element(Declaration)
|
||||
|
||||
@@ -83,6 +84,8 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
||||
val whileLoop by element(Expression, loop)
|
||||
|
||||
val block by element(Expression, expression)
|
||||
val lazyBlock by element(Expression, block)
|
||||
|
||||
val binaryLogicExpression by element(Expression, expression)
|
||||
val jump by sealedElement(Expression, expression)
|
||||
val loopJump by element(Expression, jump)
|
||||
|
||||
+3
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -173,7 +173,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
publicImplementation()
|
||||
}
|
||||
|
||||
impl(block, "FirLazyBlock") {
|
||||
impl(lazyBlock) {
|
||||
val error = """error("FirLazyBlock should be calculated before accessing")"""
|
||||
default("source") {
|
||||
value = error
|
||||
@@ -191,7 +191,6 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
value = error
|
||||
withGetter = true
|
||||
}
|
||||
publicImplementation()
|
||||
}
|
||||
|
||||
impl(errorLoop) {
|
||||
@@ -204,7 +203,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
publicImplementation()
|
||||
}
|
||||
|
||||
impl(expression, "FirLazyExpression") {
|
||||
impl(lazyExpression) {
|
||||
val error = """error("FirLazyExpression should be calculated before accessing")"""
|
||||
default("typeRef") {
|
||||
value = error
|
||||
@@ -214,7 +213,6 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
||||
value = error
|
||||
withGetter = true
|
||||
}
|
||||
publicImplementation()
|
||||
}
|
||||
|
||||
impl(functionCall) {
|
||||
|
||||
Reference in New Issue
Block a user