FIR/UAST: commonize expression list

This commit is contained in:
Jinseong Jeon
2021-06-14 17:03:38 -07:00
committed by Ilya Kirillov
parent 2e58b57db9
commit 4e4b104488
2 changed files with 5 additions and 14 deletions
@@ -0,0 +1,28 @@
/*
* 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 com.intellij.psi.PsiElement
import org.jetbrains.uast.UElement
import org.jetbrains.uast.UExpression
import org.jetbrains.uast.UExpressionList
import org.jetbrains.uast.UastSpecialExpressionKind
import org.jetbrains.uast.kotlin.kinds.KotlinSpecialExpressionKinds
open class KotlinUExpressionList(
override val sourcePsi: PsiElement?,
override val kind: UastSpecialExpressionKind, // original element
givenParent: UElement?
) : KotlinAbstractUExpression(givenParent), UExpressionList, KotlinUElementWithType, KotlinEvaluatableUElement {
override lateinit var expressions: List<UExpression>
companion object {
fun createClassBody(psi: PsiElement?, uastParent: UElement?): KotlinUExpressionList =
KotlinUExpressionList(psi, KotlinSpecialExpressionKinds.CLASS_BODY, uastParent).apply {
expressions = emptyList()
}
}
}