Skip to content

Commit

Permalink
Revert lastFound logic on %LOOKUP
Browse files Browse the repository at this point in the history
  • Loading branch information
dom-apuliasoft committed Dec 11, 2024
1 parent 17134ce commit d4507ec
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,14 @@ class ExpressionEvaluation(
}

override fun eval(expression: LookupExpr): Value = proxyLogging(expression) {
val result = lookup(
lookup(
array = expression.array.evalWith(this) as ArrayValue,
arrayType = expression.array.type() as ArrayType,
searchedValue = expression.searchedValued.evalWith(this),
start = expression.start?.evalWith(this)?.asInt(),
length = expression.length?.evalWith(this)?.asInt(),
operator = ComparisonOperator.EQ
)

// %LOOKUP is relevant for %FOUND
interpreterStatus.lastFound = result != IntValue.ZERO

result
}

override fun eval(expression: LookupGtExpr): Value = proxyLogging(expression) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ open class MULANGT10BaseCodopTest : MULANGTTest() {
*/
@Test
fun executeMUDRNRAPU00280() {
val expected = listOf("1", "0", "1", "0")
val expected = listOf("1", "0")
assertEquals(expected, "smeup/MUDRNRAPU00280".outputOf(configuration = smeupConfig))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,5 @@
C 'FOO' LOOKUP ARY 26
C EVAL FND=%FOUND
C FND DSPLY
C* Lookup expression found
C EVAL RESULT=%LOOKUP('ABC':ARY)
C EVAL FND=%FOUND
C FND DSPLY
C* Lookup expression not found
C EVAL RESULT=%LOOKUP('FOO':ARY)
C EVAL FND=%FOUND
C FND DSPLY

C SETON RT

0 comments on commit d4507ec

Please sign in to comment.