- added handling for shift and bit operators.

- added the '>>>' (unsigned shift) operator. Although, with unsigned numbers available, this is technically not really needed, DECORATE supports this so ZScript should, too, if only for the benefit of making conversion tools easier to handle.
This commit is contained in:
Christoph Oelckers 2016-10-17 15:52:29 +02:00
commit 23a2a19a78
5 changed files with 19 additions and 4 deletions

View file

@ -2425,6 +2425,14 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast)
case PEX_Pow:
return new FxPow(left, right);
case PEX_LeftShift:
case PEX_RightShift:
case PEX_URightShift:
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);
default:
I_Error("Binary operator %d not implemented yet", op);
}