New J2K: Add JKBlockStatementWithoutBrackets
This commit is contained in:
committed by
Ilya Kirillov
parent
4b0840beb1
commit
03131dc138
@@ -619,6 +619,10 @@ class NewCodeBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitBlockStatementWithoutBrackets(blockStatementWithoutBrackets: JKBlockStatementWithoutBrackets) {
|
||||
blockStatementWithoutBrackets.block.accept(this)
|
||||
}
|
||||
|
||||
override fun visitExpressionStatement(expressionStatement: JKExpressionStatement) {
|
||||
printer.printIndent()
|
||||
expressionStatement.expression.accept(this)
|
||||
|
||||
@@ -300,6 +300,12 @@ class JKBlockStatementImpl(block: JKBlock) : JKBlockStatement, JKBranchElementBa
|
||||
override fun <R, D> accept(visitor: JKVisitor<R, D>, data: D): R = visitor.visitBlockStatement(this, data)
|
||||
}
|
||||
|
||||
class JKBlockStatementWithoutBracketsImpl(block: JKBlock) : JKBlockStatementWithoutBrackets, JKBranchElementBase(), PsiOwner by PsiOwnerImpl() {
|
||||
override var block by child(block)
|
||||
|
||||
override fun <R, D> accept(visitor: JKVisitor<R, D>, data: D): R = visitor.visitBlockStatementWithoutBrackets(this, data)
|
||||
}
|
||||
|
||||
class JKThisExpressionImpl(qualifierLabel: JKLabel) : JKThisExpression, JKBranchElementBase(), PsiOwner by PsiOwnerImpl() {
|
||||
override var qualifierLabel: JKLabel by child(qualifierLabel)
|
||||
override fun <R, D> accept(visitor: JKVisitor<R, D>, data: D): R = visitor.visitThisExpression(this, data)
|
||||
|
||||
@@ -296,6 +296,10 @@ interface JKBlockStatement : JKStatement, JKBranchElement {
|
||||
var block: JKBlock
|
||||
}
|
||||
|
||||
interface JKBlockStatementWithoutBrackets : JKStatement, JKBranchElement {
|
||||
var block: JKBlock
|
||||
}
|
||||
|
||||
interface JKThisExpression : JKExpression {
|
||||
var qualifierLabel: JKLabel
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ interface JKVisitor<out R, in D> {
|
||||
fun visitStubExpression(stubExpression: JKStubExpression, data: D): R = visitExpression(stubExpression, data)
|
||||
fun visitLoopStatement(loopStatement: JKLoopStatement, data: D): R = visitStatement(loopStatement, data)
|
||||
fun visitBlockStatement(blockStatement: JKBlockStatement, data: D): R = visitStatement(blockStatement, data)
|
||||
fun visitBlockStatementWithoutBrackets(blockStatementWithoutBrackets: JKBlockStatementWithoutBrackets, data: D): R = visitStatement(blockStatementWithoutBrackets, data)
|
||||
fun visitThisExpression(thisExpression: JKThisExpression, data: D): R = visitExpression(thisExpression, data)
|
||||
fun visitSuperExpression(superExpression: JKSuperExpression, data: D): R = visitExpression(superExpression, data)
|
||||
fun visitWhileStatement(whileStatement: JKWhileStatement, data: D): R = visitLoopStatement(whileStatement, data)
|
||||
|
||||
@@ -97,6 +97,8 @@ interface JKVisitorVoid : JKVisitor<Unit, Nothing?> {
|
||||
override fun visitLoopStatement(loopStatement: JKLoopStatement, data: Nothing?) = visitLoopStatement(loopStatement)
|
||||
fun visitBlockStatement(blockStatement: JKBlockStatement) = visitStatement(blockStatement, null)
|
||||
override fun visitBlockStatement(blockStatement: JKBlockStatement, data: Nothing?) = visitBlockStatement(blockStatement)
|
||||
fun visitBlockStatementWithoutBrackets(blockStatementWithoutBrackets: JKBlockStatementWithoutBrackets) = visitStatement(blockStatementWithoutBrackets, null)
|
||||
override fun visitBlockStatementWithoutBrackets(blockStatementWithoutBrackets: JKBlockStatementWithoutBrackets, data: Nothing?) = visitBlockStatementWithoutBrackets(blockStatementWithoutBrackets)
|
||||
fun visitThisExpression(thisExpression: JKThisExpression) = visitExpression(thisExpression, null)
|
||||
override fun visitThisExpression(thisExpression: JKThisExpression, data: Nothing?) = visitThisExpression(thisExpression)
|
||||
fun visitSuperExpression(superExpression: JKSuperExpression) = visitExpression(superExpression, null)
|
||||
|
||||
Reference in New Issue
Block a user