Implement encodeReturn

This commit is contained in:
Asger F
2024-06-26 13:27:18 +02:00
parent 5811a3c5a6
commit b0ea81276b

View File

@@ -380,7 +380,14 @@ module Steps = Private::Steps<FlowSummaryStepInput>;
* `arg` will be printed in square brackets (`[]`) after the result, unless
* `arg` is the empty string.
*/
string encodeReturn(ReturnKind rk, string arg) { none() }
string encodeReturn(ReturnKind rk, string arg) {
result = "ReturnValue" and
(
rk = MkNormalReturnKind() and arg = ""
or
rk = MkExceptionalReturnKind() and arg = "exception"
)
}
/**
* Gets the textual representation of without-content `c` used in MaD.