mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
- handle trinary conditional statement.
This commit is contained in:
parent
a6a0c4b93c
commit
1c21dbc44c
1 changed files with 14 additions and 4 deletions
|
@ -2471,7 +2471,7 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast)
|
|||
case PEX_BitAnd:
|
||||
case PEX_BitOr:
|
||||
case PEX_BitXor:
|
||||
return new FxBinaryInt(op == PEX_LeftShift ? TK_LShift : op == PEX_RightShift ? TK_RShift : op == PEX_URightShift? TK_URShift : op == PEX_BitAnd ? '&' : op == PEX_BitOr ? '|' : '^', left, right);
|
||||
return new FxBinaryInt(op == PEX_LeftShift ? TK_LShift : op == PEX_RightShift ? TK_RShift : op == PEX_URightShift ? TK_URShift : op == PEX_BitAnd ? '&' : op == PEX_BitOr ? '|' : '^', left, right);
|
||||
|
||||
case PEX_BoolOr:
|
||||
case PEX_BoolAnd:
|
||||
|
@ -2503,6 +2503,16 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast)
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case AST_ExprTrinary:
|
||||
{
|
||||
auto trinary = static_cast<ZCC_ExprTrinary *>(ast);
|
||||
auto condition = ConvertNode(trinary->Test);
|
||||
auto left = ConvertNode(trinary->Left);
|
||||
auto right = ConvertNode(trinary->Right);
|
||||
|
||||
return new FxConditional(condition, left, right);
|
||||
}
|
||||
}
|
||||
|
||||
// only for development. I_Error is more convenient here than a normal error.
|
||||
|
|
Loading…
Reference in a new issue