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/262 mock oc feod #474

Merged
merged 8 commits into from
Mar 22, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private val modules = SerializersModule {
subclass(DOWxxStmt::class)
subclass(EvalStmt::class)
subclass(ExecuteSubroutine::class)
subclass(FeodStmt::class)
subclass(ForStmt::class)
subclass(GotoStmt::class)
subclass(IfStmt::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2077,4 +2077,13 @@ data class UnlockStmt(
override fun execute(interpreter: InterpreterCore) {
// TODO
}
}

@Serializable
data class FeodStmt(
override val position: Position? = null
) : Statement(position) {
override fun execute(interpreter: InterpreterCore) {
// TODO
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,9 @@ internal fun Cspec_fixed_standardContext.toAst(conf: ToAstConfiguration = ToAstC
this.csUNLOCK() != null -> this.csUNLOCK()
.let { it.cspec_fixed_standard_parts().validate(stmt = it.toAst(conf), conf = conf) }

this.csFEOD() != null -> this.csFEOD()
.let { it.cspec_fixed_standard_parts().validate(stmt = it.toAst(conf), conf = conf) }

else -> todo(conf = conf)
}
}
Expand Down Expand Up @@ -1997,6 +2000,12 @@ internal fun CsUNLOCKContext.toAst(conf: ToAstConfiguration = ToAstConfiguration
return UnlockStmt(position)
}

// TODO
internal fun CsFEODContext.toAst(conf: ToAstConfiguration = ToAstConfiguration()): Statement {
val position = toPosition(conf.considerPosition)
return FeodStmt(position)
}

/**
* Run a block. In case of error throws an error encapsulating useful information
* like node position
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
package com.smeup.rpgparser.smeup

open class MULANGT52FileAccess2Test : MULANGTTest()
import org.junit.Test
import kotlin.test.assertEquals

open class MULANGT52FileAccess2Test : MULANGTTest() {
/**
* Mock FEOD operation code
* @see #262
*/
@Test
fun executeT52_A07_P02() {
val expected = listOf("")
assertEquals(expected, "smeup/T52_A07_P02".outputOf())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
C FEOD MULANGTL
C '' DSPLY