New J2K: Fix multiple update expressions in psi for statements
This commit is contained in:
committed by
Ilya Kirillov
parent
f6f619ea27
commit
4a16f4cc9f
@@ -454,7 +454,16 @@ class JavaToJKTreeBuilder(var symbolProvider: JKSymbolProvider) {
|
||||
JKIfElseStatementImpl(with(expressionTreeMapper) { condition.toJK() }, thenBranch.toJK(), elseBranch.toJK())
|
||||
|
||||
is PsiForStatement -> JKJavaForLoopStatementImpl(
|
||||
initialization.toJK(), with(expressionTreeMapper) { condition.toJK() }, update.toJK(), body.toJK()
|
||||
initialization.toJK(),
|
||||
with(expressionTreeMapper) { condition.toJK() },
|
||||
when (update) {
|
||||
is PsiExpressionListStatement ->
|
||||
(update as PsiExpressionListStatement).expressionList.expressions.map {
|
||||
JKExpressionStatementImpl(with(expressionTreeMapper) { it.toJK() })
|
||||
}
|
||||
else -> listOf(update.toJK())
|
||||
},
|
||||
body.toJK()
|
||||
)
|
||||
is PsiForeachStatement ->
|
||||
JKForInStatementImpl(
|
||||
@@ -466,7 +475,6 @@ class JavaToJKTreeBuilder(var symbolProvider: JKSymbolProvider) {
|
||||
is PsiWhileStatement -> JKWhileStatementImpl(with(expressionTreeMapper) { condition.toJK() }, body.toJK())
|
||||
is PsiDoWhileStatement -> JKDoWhileStatementImpl(body.toJK(), with(expressionTreeMapper) { condition.toJK() })
|
||||
|
||||
|
||||
is PsiSwitchStatement -> {
|
||||
val cases = mutableListOf<JKJavaSwitchCase>()
|
||||
for (statement in body?.statements.orEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user