New J2K: Add support of enum consts initializingClass
This commit is contained in:
committed by
Ilya Kirillov
parent
49a8a8f116
commit
763ea3480d
@@ -321,6 +321,7 @@ class JavaToJKTreeBuilder(var symbolProvider: JKSymbolProvider) {
|
|||||||
JKEnumConstantImpl(
|
JKEnumConstantImpl(
|
||||||
JKNameIdentifierImpl(name),
|
JKNameIdentifierImpl(name),
|
||||||
with(expressionTreeMapper) { argumentList.toJK() },
|
with(expressionTreeMapper) { argumentList.toJK() },
|
||||||
|
initializingClass?.createClassBody() ?: JKEmptyClassBodyImpl(),
|
||||||
JKTypeElementImpl(JKClassTypeImpl(symbolProvider.provideDirectSymbol(containingClass!!) as JKClassSymbol, emptyList()))
|
JKTypeElementImpl(JKClassTypeImpl(symbolProvider.provideDirectSymbol(containingClass!!) as JKClassSymbol, emptyList()))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -253,6 +253,9 @@ class NewCodeBuilder {
|
|||||||
enumConstant.arguments.accept(this)
|
enumConstant.arguments.accept(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (enumConstant.body !is JKEmptyClassBody) {
|
||||||
|
enumConstant.body.accept(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun visitKtInitDeclaration(ktInitDeclaration: JKKtInitDeclaration) {
|
override fun visitKtInitDeclaration(ktInitDeclaration: JKKtInitDeclaration) {
|
||||||
|
|||||||
@@ -460,10 +460,12 @@ class JKTypeParameterTypeImpl(
|
|||||||
class JKEnumConstantImpl(
|
class JKEnumConstantImpl(
|
||||||
name: JKNameIdentifier,
|
name: JKNameIdentifier,
|
||||||
arguments: JKExpressionList,
|
arguments: JKExpressionList,
|
||||||
|
body: JKClassBody,
|
||||||
type: JKTypeElement
|
type: JKTypeElement
|
||||||
) : JKEnumConstant, JKBranchElementBase(), PsiOwner by PsiOwnerImpl() {
|
) : JKEnumConstant, JKBranchElementBase(), PsiOwner by PsiOwnerImpl() {
|
||||||
override var name: JKNameIdentifier by child(name)
|
override var name: JKNameIdentifier by child(name)
|
||||||
override val arguments: JKExpressionList by child(arguments)
|
override val arguments: JKExpressionList by child(arguments)
|
||||||
|
override val body: JKClassBody by child(body)
|
||||||
override var type: JKTypeElement by child(type)
|
override var type: JKTypeElement by child(type)
|
||||||
override var initializer: JKExpression by child(JKStubExpressionImpl())
|
override var initializer: JKExpression by child(JKStubExpressionImpl())
|
||||||
|
|
||||||
|
|||||||
@@ -383,6 +383,7 @@ interface JKTypeParameterListOwner : JKTreeElement {
|
|||||||
|
|
||||||
interface JKEnumConstant : JKVariable {
|
interface JKEnumConstant : JKVariable {
|
||||||
val arguments: JKExpressionList
|
val arguments: JKExpressionList
|
||||||
|
val body: JKClassBody
|
||||||
}
|
}
|
||||||
|
|
||||||
interface JKForInStatement : JKStatement {
|
interface JKForInStatement : JKStatement {
|
||||||
|
|||||||
Reference in New Issue
Block a user