119 |
|
|
120 |
bool CoreVMFunction_exit::acceptsArgType(vmint iArg, ExprType_t type) const { |
bool CoreVMFunction_exit::acceptsArgType(vmint iArg, ExprType_t type) const { |
121 |
if (!vm->isExitResultEnabled()) return false; |
if (!vm->isExitResultEnabled()) return false; |
122 |
return type == INT_EXPR || type == STRING_EXPR; |
return type == INT_EXPR || type == REAL_EXPR || type == STRING_EXPR; |
123 |
} |
} |
124 |
|
|
125 |
VMFnResult* CoreVMFunction_exit::exec(VMFnArgs* args) { |
VMFnResult* CoreVMFunction_exit::exec(VMFnArgs* args) { |
131 |
ctx->exitRes.intLiteral.value = args->arg(0)->asInt()->evalInt(); |
ctx->exitRes.intLiteral.value = args->arg(0)->asInt()->evalInt(); |
132 |
ctx->exitRes.value = &ctx->exitRes.intLiteral; |
ctx->exitRes.value = &ctx->exitRes.intLiteral; |
133 |
break; |
break; |
134 |
|
case REAL_EXPR: |
135 |
|
ctx->exitRes.realLiteral.value = args->arg(0)->asReal()->evalReal(); |
136 |
|
ctx->exitRes.value = &ctx->exitRes.realLiteral; |
137 |
|
break; |
138 |
case STRING_EXPR: |
case STRING_EXPR: |
139 |
ctx->exitRes.stringLiteral.value = args->arg(0)->asString()->evalStr(); |
ctx->exitRes.stringLiteral.value = args->arg(0)->asString()->evalStr(); |
140 |
ctx->exitRes.value = &ctx->exitRes.stringLiteral; |
ctx->exitRes.value = &ctx->exitRes.stringLiteral; |