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

Feature/ls24005143/indicators with define #671

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -1302,6 +1302,14 @@ data class DefineStmt(
get() = "DEFINE"

override fun dataDefinition(): List<InStatementDataDefinition> {
// FIXME: If indicator was not priorly SET (SETON or SETOFF), program should error
val indicatorPattern = Regex("\\*IN\\d\\d")
val isIndicator = originalName.trim().uppercase().matches(indicatorPattern)
if (isIndicator) {
val newDefinition = InStatementDataDefinition(newVarName, BooleanType, position)
return listOf(newDefinition)
}

val containingCU = this.ancestor(CompilationUnit::class.java)
?: return emptyList()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,16 @@ open class MULANGT02ConstAndDSpecTest : MULANGTTest() {
assertEquals(expected, "smeup/MUDRNRAPU00270".outputOf(configuration = smeupConfig))
}

/**
* DEFINE with indicator as original name
* @see #LS24005143
*/
@Test
fun executeMUDRNRAPU00273() {
val expected = listOf("1", "0")
assertEquals(expected, "smeup/MUDRNRAPU00273".outputOf(configuration = smeupConfig))
}

/**
* Truncation of number by using Z-ADD. The source is greater than destination.
* Source and destination are integer.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
V* ==============================================================
V* 28/11/2024 APU002 Creation
V* ==============================================================
O * PROGRAM GOAL
O * DEFINE on an indicator
V* ==============================================================
O * JARIKO ANOMALY
O * Before the fix, jariko throw a DataReference error
V* ==============================================================
C SETON 10
C EVAL XIN10=*ON
C XIN10 DSPLY
C EVAL XIN10=*OFF
C XIN10 DSPLY
C *LIKE DEFINE *IN10 XIN10