From 50f750187bd12cb672776c4f0084138575d36499 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Wed, 26 May 2021 23:25:02 -0700 Subject: [PATCH] FIR/UAST: commonize loop/break/continue expressions --- .../KotlinUDoWhileExpression.kt | 29 +++++++++++++++ .../KotlinUWhileExpression.kt | 26 ++++++++++++++ .../expressions/KotlinUBreakExpression.kt | 19 ++++++++++ .../expressions/KotlinUContinueExpression.kt | 19 ++++++++++ .../uast/kotlin/FirKotlinConverter.kt | 7 ++++ .../testData/declaration/doWhile.kt | 6 ++++ .../testData/declaration/doWhile.log.fe10.txt | 15 ++++++++ .../testData/declaration/doWhile.log.fir.txt | 9 +++++ .../declaration/doWhile.render.fe10.txt | 9 +++++ .../declaration/doWhile.render.fir.txt | 9 +++++ .../legacyRenderLog/Lambdas.log.fir.txt | 4 ++- .../legacyRenderLog/Lambdas.render.fir.txt | 3 +- .../legacyTypes/Lambdas.types.fir.txt | 4 ++- .../legacyValues/Lambdas.values.fir.txt | 4 ++- .../FE1UastDeclarationTestGenerated.java | 5 +++ .../FirUastDeclarationTestGenerated.java | 5 +++ .../expressions/KotlinUBreakExpression.kt | 30 ---------------- .../expressions/KotlinUContinueExpression.kt | 30 ---------------- .../expressions/KotlinUDoWhileExpression.kt | 36 ------------------- .../expressions/KotlinUWhileExpression.kt | 33 ----------------- 20 files changed, 169 insertions(+), 133 deletions(-) create mode 100644 plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/controlStructures/KotlinUDoWhileExpression.kt create mode 100644 plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/controlStructures/KotlinUWhileExpression.kt create mode 100644 plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUBreakExpression.kt create mode 100644 plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUContinueExpression.kt create mode 100644 plugins/uast-kotlin-fir/testData/declaration/doWhile.kt create mode 100644 plugins/uast-kotlin-fir/testData/declaration/doWhile.log.fe10.txt create mode 100644 plugins/uast-kotlin-fir/testData/declaration/doWhile.log.fir.txt create mode 100644 plugins/uast-kotlin-fir/testData/declaration/doWhile.render.fe10.txt create mode 100644 plugins/uast-kotlin-fir/testData/declaration/doWhile.render.fir.txt delete mode 100644 plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUBreakExpression.kt delete mode 100644 plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUContinueExpression.kt delete mode 100644 plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUDoWhileExpression.kt delete mode 100644 plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUWhileExpression.kt diff --git a/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/controlStructures/KotlinUDoWhileExpression.kt b/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/controlStructures/KotlinUDoWhileExpression.kt new file mode 100644 index 00000000000..6ddcb414cf9 --- /dev/null +++ b/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/controlStructures/KotlinUDoWhileExpression.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2021 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. + */ + +package org.jetbrains.uast.kotlin + +import org.jetbrains.kotlin.psi.KtDoWhileExpression +import org.jetbrains.uast.UDoWhileExpression +import org.jetbrains.uast.UElement +import org.jetbrains.uast.UIdentifier + +class KotlinUDoWhileExpression( + override val sourcePsi: KtDoWhileExpression, + givenParent: UElement? +) : KotlinAbstractUExpression(givenParent), UDoWhileExpression { + override val condition by lz { + baseResolveProviderService.baseKotlinConverter.convertOrEmpty(sourcePsi.condition, this) + } + override val body by lz { + baseResolveProviderService.baseKotlinConverter.convertOrEmpty(sourcePsi.body, this) + } + + override val doIdentifier: UIdentifier + get() = KotlinUIdentifier(null, this) + + override val whileIdentifier: UIdentifier + get() = KotlinUIdentifier(null, this) +} diff --git a/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/controlStructures/KotlinUWhileExpression.kt b/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/controlStructures/KotlinUWhileExpression.kt new file mode 100644 index 00000000000..dc659515566 --- /dev/null +++ b/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/controlStructures/KotlinUWhileExpression.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2010-2021 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. + */ + +package org.jetbrains.uast.kotlin + +import org.jetbrains.kotlin.psi.KtWhileExpression +import org.jetbrains.uast.UElement +import org.jetbrains.uast.UIdentifier +import org.jetbrains.uast.UWhileExpression + +class KotlinUWhileExpression( + override val sourcePsi: KtWhileExpression, + givenParent: UElement? +) : KotlinAbstractUExpression(givenParent), UWhileExpression { + override val condition by lz { + baseResolveProviderService.baseKotlinConverter.convertOrEmpty(sourcePsi.condition, this) + } + override val body by lz { + baseResolveProviderService.baseKotlinConverter.convertOrEmpty(sourcePsi.body, this) + } + + override val whileIdentifier: UIdentifier + get() = KotlinUIdentifier(null, this) +} diff --git a/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUBreakExpression.kt b/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUBreakExpression.kt new file mode 100644 index 00000000000..a6538e13a42 --- /dev/null +++ b/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUBreakExpression.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2021 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. + */ + +package org.jetbrains.uast.kotlin + +import org.jetbrains.kotlin.psi.KtBreakExpression +import org.jetbrains.uast.UBreakExpression +import org.jetbrains.uast.UElement +import org.jetbrains.uast.kotlin.KotlinAbstractUExpression + +class KotlinUBreakExpression( + override val sourcePsi: KtBreakExpression, + givenParent: UElement? +) : KotlinAbstractUExpression(givenParent), UBreakExpression { + override val label: String? + get() = sourcePsi.getLabelName() +} diff --git a/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUContinueExpression.kt b/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUContinueExpression.kt new file mode 100644 index 00000000000..6c164b5974e --- /dev/null +++ b/plugins/uast-kotlin-base/src/org/jetbrains/uast/kotlin/expressions/KotlinUContinueExpression.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2021 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. + */ + +package org.jetbrains.uast.kotlin + +import org.jetbrains.kotlin.psi.KtContinueExpression +import org.jetbrains.uast.UContinueExpression +import org.jetbrains.uast.UElement +import org.jetbrains.uast.kotlin.KotlinAbstractUExpression + +class KotlinUContinueExpression( + override val sourcePsi: KtContinueExpression, + givenParent: UElement? +) : KotlinAbstractUExpression(givenParent), UContinueExpression { + override val label: String? + get() = sourcePsi.getLabelName() +} diff --git a/plugins/uast-kotlin-fir/src/org/jetbrains/uast/kotlin/FirKotlinConverter.kt b/plugins/uast-kotlin-fir/src/org/jetbrains/uast/kotlin/FirKotlinConverter.kt index fef25895b88..150b2ecb28d 100644 --- a/plugins/uast-kotlin-fir/src/org/jetbrains/uast/kotlin/FirKotlinConverter.kt +++ b/plugins/uast-kotlin-fir/src/org/jetbrains/uast/kotlin/FirKotlinConverter.kt @@ -268,11 +268,18 @@ internal object FirKotlinConverter : BaseKotlinConverter { } is KtCollectionLiteralExpression -> expr(build(::KotlinUCollectionLiteralExpression)) is KtConstantExpression -> expr(build(::KotlinULiteralExpression)) + is KtBlockExpression -> expr { // TODO: differentiate lambda FirKotlinUBlockExpression(expression, givenParent) } is KtReturnExpression -> expr(build(::KotlinUReturnExpression)) + + is KtBreakExpression -> expr(build(::KotlinUBreakExpression)) + is KtContinueExpression -> expr(build(::KotlinUContinueExpression)) + is KtDoWhileExpression -> expr(build(::KotlinUDoWhileExpression)) + is KtWhileExpression -> expr(build(::KotlinUWhileExpression)) + else -> expr(build(::UnknownKotlinExpression)) } } diff --git a/plugins/uast-kotlin-fir/testData/declaration/doWhile.kt b/plugins/uast-kotlin-fir/testData/declaration/doWhile.kt new file mode 100644 index 00000000000..bbba9ea94f7 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/declaration/doWhile.kt @@ -0,0 +1,6 @@ +fun test() { + var x : String? = null + do { + x = "non-null" + } while (x != null) +} diff --git a/plugins/uast-kotlin-fir/testData/declaration/doWhile.log.fe10.txt b/plugins/uast-kotlin-fir/testData/declaration/doWhile.log.fe10.txt new file mode 100644 index 00000000000..0a43dadcba7 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/declaration/doWhile.log.fe10.txt @@ -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") diff --git a/plugins/uast-kotlin-fir/testData/declaration/doWhile.log.fir.txt b/plugins/uast-kotlin-fir/testData/declaration/doWhile.log.fir.txt new file mode 100644 index 00000000000..3bf26b297d9 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/declaration/doWhile.log.fir.txt @@ -0,0 +1,9 @@ +UFile (package = ) + UClass (name = DoWhileKt) + UMethod (name = test) + UBlockExpression + [!] UnknownKotlinExpression (PROPERTY) + UDoWhileExpression + [!] UnknownKotlinExpression (BINARY_EXPRESSION) + UBlockExpression + [!] UnknownKotlinExpression (BINARY_EXPRESSION) diff --git a/plugins/uast-kotlin-fir/testData/declaration/doWhile.render.fe10.txt b/plugins/uast-kotlin-fir/testData/declaration/doWhile.render.fe10.txt new file mode 100644 index 00000000000..9d2cc9b6c70 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/declaration/doWhile.render.fe10.txt @@ -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) + + } +} diff --git a/plugins/uast-kotlin-fir/testData/declaration/doWhile.render.fir.txt b/plugins/uast-kotlin-fir/testData/declaration/doWhile.render.fir.txt new file mode 100644 index 00000000000..8dfad75ea50 --- /dev/null +++ b/plugins/uast-kotlin-fir/testData/declaration/doWhile.render.fir.txt @@ -0,0 +1,9 @@ +public final class DoWhileKt { + public static final fun test() : void { + [!] UnknownKotlinExpression (PROPERTY) + do { + [!] UnknownKotlinExpression (BINARY_EXPRESSION) + }while ([!] UnknownKotlinExpression (BINARY_EXPRESSION)) + + } +} diff --git a/plugins/uast-kotlin-fir/testData/legacyRenderLog/Lambdas.log.fir.txt b/plugins/uast-kotlin-fir/testData/legacyRenderLog/Lambdas.log.fir.txt index 100da2741ec..f8797bc30de 100644 --- a/plugins/uast-kotlin-fir/testData/legacyRenderLog/Lambdas.log.fir.txt +++ b/plugins/uast-kotlin-fir/testData/legacyRenderLog/Lambdas.log.fir.txt @@ -12,4 +12,6 @@ UFile (package = ) [!] UnknownKotlinExpression (CALL_EXPRESSION) UMethod (name = lambdaInPlaceCall) UBlockExpression - [!] UnknownKotlinExpression (WHILE) + UWhileExpression + [!] UnknownKotlinExpression (CALL_EXPRESSION) + UBlockExpression diff --git a/plugins/uast-kotlin-fir/testData/legacyRenderLog/Lambdas.render.fir.txt b/plugins/uast-kotlin-fir/testData/legacyRenderLog/Lambdas.render.fir.txt index 10b7b5a7535..c7056b4a782 100644 --- a/plugins/uast-kotlin-fir/testData/legacyRenderLog/Lambdas.render.fir.txt +++ b/plugins/uast-kotlin-fir/testData/legacyRenderLog/Lambdas.render.fir.txt @@ -10,6 +10,7 @@ public final class LambdasKt { [!] UnknownKotlinExpression (CALL_EXPRESSION) } public static final fun lambdaInPlaceCall() : void { - [!] UnknownKotlinExpression (WHILE) + while ([!] UnknownKotlinExpression (CALL_EXPRESSION)) { + } } } diff --git a/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fir.txt b/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fir.txt index e5d5dc48a85..ccb76aa37af 100644 --- a/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fir.txt +++ b/plugins/uast-kotlin-fir/testData/legacyTypes/Lambdas.types.fir.txt @@ -12,4 +12,6 @@ UFile (package = ) [import java.util.stream.Stream...] [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] UMethod (name = lambdaInPlaceCall) [public static final fun lambdaInPlaceCall() : void {...}] UBlockExpression [{...}] - [!] UnknownKotlinExpression (WHILE) [[!] UnknownKotlinExpression (WHILE)] + UWhileExpression [while ([!] UnknownKotlinExpression (CALL_EXPRESSION)) {...}] + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] + UBlockExpression [{...}] diff --git a/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fir.txt b/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fir.txt index b1999319174..1753e23de45 100644 --- a/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fir.txt +++ b/plugins/uast-kotlin-fir/testData/legacyValues/Lambdas.values.fir.txt @@ -12,4 +12,6 @@ UFile (package = ) [import java.util.stream.Stream...] [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined UMethod (name = lambdaInPlaceCall) [public static final fun lambdaInPlaceCall() : void {...}] UBlockExpression [{...}] = Undetermined - [!] UnknownKotlinExpression (WHILE) [[!] UnknownKotlinExpression (WHILE)] = Undetermined + UWhileExpression [while ([!] UnknownKotlinExpression (CALL_EXPRESSION)) {...}] = Undetermined + [!] UnknownKotlinExpression (CALL_EXPRESSION) [[!] UnknownKotlinExpression (CALL_EXPRESSION)] = Undetermined + UBlockExpression [{...}] = Undetermined diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1UastDeclarationTestGenerated.java b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1UastDeclarationTestGenerated.java index ea37c145baf..b7470759d80 100644 --- a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1UastDeclarationTestGenerated.java +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FE1UastDeclarationTestGenerated.java @@ -29,6 +29,11 @@ public class FE1UastDeclarationTestGenerated extends AbstractFE1UastDeclarationT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/uast-kotlin-fir/testData/declaration"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @TestMetadata("doWhile.kt") + public void testDoWhile() throws Exception { + runTest("plugins/uast-kotlin-fir/testData/declaration/doWhile.kt"); + } + @TestMetadata("facade.kt") public void testFacade() throws Exception { runTest("plugins/uast-kotlin-fir/testData/declaration/facade.kt"); diff --git a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirUastDeclarationTestGenerated.java b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirUastDeclarationTestGenerated.java index 904557eb955..97f2ff4d195 100644 --- a/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirUastDeclarationTestGenerated.java +++ b/plugins/uast-kotlin-fir/tests/org/jetbrains/uast/test/kotlin/FirUastDeclarationTestGenerated.java @@ -29,6 +29,11 @@ public class FirUastDeclarationTestGenerated extends AbstractFirUastDeclarationT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/uast-kotlin-fir/testData/declaration"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @TestMetadata("doWhile.kt") + public void testDoWhile() throws Exception { + runTest("plugins/uast-kotlin-fir/testData/declaration/doWhile.kt"); + } + @TestMetadata("facade.kt") public void testFacade() throws Exception { runTest("plugins/uast-kotlin-fir/testData/declaration/facade.kt"); diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUBreakExpression.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUBreakExpression.kt deleted file mode 100644 index ba025bc6612..00000000000 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUBreakExpression.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.uast.kotlin.expressions - -import org.jetbrains.kotlin.psi.KtBreakExpression -import org.jetbrains.uast.UBreakExpression -import org.jetbrains.uast.UElement -import org.jetbrains.uast.kotlin.KotlinAbstractUExpression - -class KotlinUBreakExpression( - override val sourcePsi: KtBreakExpression, - givenParent: UElement? -) : KotlinAbstractUExpression(givenParent), UBreakExpression { - override val label: String? - get() = sourcePsi.getLabelName() -} \ No newline at end of file diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUContinueExpression.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUContinueExpression.kt deleted file mode 100644 index e520864356c..00000000000 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUContinueExpression.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.uast.kotlin.expressions - -import org.jetbrains.kotlin.psi.KtContinueExpression -import org.jetbrains.uast.UContinueExpression -import org.jetbrains.uast.UElement -import org.jetbrains.uast.kotlin.KotlinAbstractUExpression - -class KotlinUContinueExpression( - override val sourcePsi: KtContinueExpression, - givenParent: UElement? -) : KotlinAbstractUExpression(givenParent), UContinueExpression { - override val label: String? - get() = sourcePsi.getLabelName() -} \ No newline at end of file diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUDoWhileExpression.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUDoWhileExpression.kt deleted file mode 100644 index 0016d5c7d16..00000000000 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUDoWhileExpression.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.uast.kotlin - -import org.jetbrains.kotlin.psi.KtDoWhileExpression -import org.jetbrains.uast.UDoWhileExpression -import org.jetbrains.uast.UElement -import org.jetbrains.uast.UIdentifier - -class KotlinUDoWhileExpression( - override val sourcePsi: KtDoWhileExpression, - givenParent: UElement? -) : KotlinAbstractUExpression(givenParent), UDoWhileExpression { - override val condition by lz { KotlinConverter.convertOrEmpty(sourcePsi.condition, this) } - override val body by lz { KotlinConverter.convertOrEmpty(sourcePsi.body, this) } - - override val doIdentifier: UIdentifier - get() = KotlinUIdentifier(null, this) - - override val whileIdentifier: UIdentifier - get() = KotlinUIdentifier(null, this) -} diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUWhileExpression.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUWhileExpression.kt deleted file mode 100644 index 6a5807fb93e..00000000000 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUWhileExpression.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.uast.kotlin - -import org.jetbrains.kotlin.psi.KtWhileExpression -import org.jetbrains.uast.UElement -import org.jetbrains.uast.UIdentifier -import org.jetbrains.uast.UWhileExpression - -class KotlinUWhileExpression( - override val sourcePsi: KtWhileExpression, - givenParent: UElement? -) : KotlinAbstractUExpression(givenParent), UWhileExpression { - override val condition by lz { KotlinConverter.convertOrEmpty(sourcePsi.condition, this) } - override val body by lz { KotlinConverter.convertOrEmpty(sourcePsi.body, this) } - - override val whileIdentifier: UIdentifier - get() = KotlinUIdentifier(null, this) -}