Skip to content

Commit

Permalink
Merge pull request #408 from smeup/bugfix/NW23001440/ununderstable_error
Browse files Browse the repository at this point in the history
Bugfix/nw23001440/ununderstable error
  • Loading branch information
FiorenzaBusi authored Feb 2, 2024
2 parents c8dfb39 + 5cf5475 commit ffa455b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<String>
val errorEvents = mutableListOf<ErrorEvent>()
Expand Down
6 changes: 6 additions & 0 deletions rpgJavaInterpreter-core/src/test/resources/ERROR11.rpgle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
V* ==============================================================
D* Missing implementation of the DOWLE opcode
D*
V* ==============================================================
C $B DOWLE 13
C ENDDO

0 comments on commit ffa455b

Please sign in to comment.