mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 16:51:31 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
95f3a9909c
3 changed files with 34 additions and 0 deletions
|
@ -892,6 +892,19 @@ public:
|
|||
ExpEmit Emit(VMFunctionBuilder *build, bool tailcall);
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FxReturnStatement
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
class FxReturnStatement : public FxTailable
|
||||
{
|
||||
public:
|
||||
FxReturnStatement(const FScriptPosition &pos);
|
||||
ExpEmit Emit(VMFunctionBuilder *build, bool tailcall);
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
@ -3484,6 +3484,21 @@ ExpEmit FxIfStatement::Emit(VMFunctionBuilder *build, bool tailcall)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FxReturnStatement::FxReturnStatement(const FScriptPosition &pos)
|
||||
: FxTailable(pos)
|
||||
{
|
||||
}
|
||||
|
||||
ExpEmit FxReturnStatement::Emit(VMFunctionBuilder *build, bool tailcall)
|
||||
{
|
||||
build->Emit(OP_RET, RET_FINAL, REGT_NIL, 0);
|
||||
return ExpEmit();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FxClassTypeCast::FxClassTypeCast(const PClass *dtype, FxExpression *x)
|
||||
: FxExpression(x->ScriptPosition)
|
||||
{
|
||||
|
|
|
@ -386,6 +386,12 @@ FxTailable *ParseActions(FScanner &sc, FState state, FString statestring, Baggag
|
|||
}
|
||||
add = new FxIfStatement(cond, true_part, false_part, sc);
|
||||
}
|
||||
else if (sc.Compare("return"))
|
||||
{ // Handle a return statement
|
||||
sc.MustGetStringName(";");
|
||||
sc.MustGetString();
|
||||
add = new FxReturnStatement(sc);
|
||||
}
|
||||
else
|
||||
{ // Handle a regular action function call
|
||||
add = ParseAction(sc, state, statestring, bag);
|
||||
|
|
Loading…
Reference in a new issue