diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/execution/Configuration.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/execution/Configuration.kt index 6dd0a3933..50a1f088f 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/execution/Configuration.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/execution/Configuration.kt @@ -164,6 +164,10 @@ data class JarikoCallback( var onCallPgmError: (errorEvent: ErrorEvent) -> Unit = { }, var logInfo: ((channel: String, message: String) -> Unit)? = null, var channelLoggingEnabled: ((channel: String) -> Boolean)? = null, + /** + * This is called for those statements mocked. + * @param mockStatement "Statement" where is get its name for the `println`. + */ var onMockStatement: ((mockStatement: MockStatement) -> Unit) = { System.err.println("Executing mock: ${it.javaClass.simpleName}") } ) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt index 8d3fed8d2..82d4041c3 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt @@ -85,6 +85,9 @@ abstract class Statement( abstract fun execute(interpreter: InterpreterCore) } +/** + * For statements with this interface there isn't execution but will be called the callback `onMockStatement`. + */ interface MockStatement interface CompositeStatement {