diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/statements.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/statements.kt index 2aaf6ff52..166579e15 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/statements.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/statements.kt @@ -54,7 +54,7 @@ internal fun BlockContext.toAst(conf: ToAstConfiguration = ToAstConfiguration()) this.begindow() != null -> this.begindow().toAst(blockContext = this, conf = conf) this.forstatement() != null -> this.forstatement().toAst(conf) this.begindou() != null -> this.begindou().toAst(blockContext = this, conf = conf) - else -> TODO(this.text.toString() + " " + toPosition(conf.considerPosition)) + else -> todo(message = "Missing composite statement implementation for this block: ${this.text}", conf = conf) } } diff --git a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/interpreter/JarikoCallbackTest.kt b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/interpreter/JarikoCallbackTest.kt index f31d2826a..4ecc05607 100644 --- a/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/interpreter/JarikoCallbackTest.kt +++ b/rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/interpreter/JarikoCallbackTest.kt @@ -397,6 +397,16 @@ class JarikoCallbackTest : AbstractTest() { executeSourceLineTest("ERROR10") } + @Test + fun executeERROR11CallBackTest() { + executePgmCallBackTest("ERROR11", SourceReferenceType.Program, "ERROR11", listOf(5)) + } + + @Test + fun executeERROR11SourceLineTest() { + executeSourceLineTest("ERROR11") + } + /** * This test simulates what a precompiler might do throws the use of the beforeParsing callback * In ERROR01.rpgle I will comment C specification to avoid a division by zero errors @@ -489,6 +499,10 @@ class JarikoCallbackTest : AbstractTest() { } } + /** + * Verify that the sourceLine is correctly set in case of error. + * ErrorEvent must contain a reference of an absolute line of the source code + * */ private fun executeSourceLineTest(pgm: String) { lateinit var lines: List val errorEvents = mutableListOf() diff --git a/rpgJavaInterpreter-core/src/test/resources/ERROR11.rpgle b/rpgJavaInterpreter-core/src/test/resources/ERROR11.rpgle new file mode 100644 index 000000000..b5f730c58 --- /dev/null +++ b/rpgJavaInterpreter-core/src/test/resources/ERROR11.rpgle @@ -0,0 +1,6 @@ + V* ============================================================== + D* Missing implementation of the DOWLE opcode + D* + V* ============================================================== + C $B DOWLE 13 + C ENDDO \ No newline at end of file