Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/nw23001440/ununderstable error #408

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading