-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
This is a continuation of #211
Currently we need to use work-arounds such:
registerNodeFactory(TryStatement::class) {
if (it.onExceptions.isEmpty()) {
// Dummy try-catch, we will just take the body
JBlockStmt(translateList(it.statements)).dummyBlock()
} else {
TODO()
}
}
Where:
/**
* We cannot directly translate a statement into a sequence of statements, so we use these dummy blocks, which we
* should later remove
*/
fun JBlockStmt.dummyBlock(): JBlockStmt {
val annotationInstance = DynamicAnnotationInstance(UUID.randomUUID().toString(), JavaGenerationLanguage.dummyBlock)
annotations.add(annotationInstance)
return this
}
Some preparatory work has been done in #211 but it must be completed so that we can write something like:
registerNodeFactory(TryStatement::class) {
if (it.onExceptions.isEmpty()) {
translateList(it.statements)
} else {
TODO()
}
}
Metadata
Metadata
Assignees
Labels
No labels