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/ls24003656/error data reference when is used api directive #582

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 @@ -205,13 +205,14 @@ open class BaseCompileTimeInterpreter(
if (it.directive().dir_api() != null) {
val apiDirective = it.directive().dir_api()
val apiId = apiDirective.toApiId(conf)
return apiId.loadAndUse { api ->
val size = apiId.loadAndUse { api ->
api.let {
it.compilationUnit.dataDefinitions.firstOrNull { def ->
def.name.equals(declName, ignoreCase = true)
}
}?.let { it.type.size }
}?.type?.size
}
if (size != null) return size
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ open class MULANGT02ConstAndDSpecTest : MULANGTTest() {
}
}

/**
* Resolves problem od Data Reference with LIKE when in the RPG source is used an API directive.
* @see LS24003656
*/
@Test
fun executeMUDRNRAPU00102() {
val expected = listOf("HELLO THERE")
assertEquals(expected, "smeup/MUDRNRAPU00102".outputOf(configuration = smeupConfig))
}

/**
* Data definition not resolved for patterns containing the ':' in XLate factor 1
* @see #LS24002758
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
D $FOO S LIKE(£FOO)
D STR S 15 INZ('HELLO THERE')

C EXSR SUB01

C *INZSR BEGSR
C EXSR £INIZI
C ENDSR


C £INIZI BEGSR
C *ENTRY PLIST
C $FOO PARM £FOO 10
C ENDSR


C SUB01 BEGSR
C IF $FOO <> 'BAR'
C STR DSPLY
C ENDIF
C ENDSR

/API QILEGEN,£OAV