1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Made operator precedence match everyone else

This commit is contained in:
Brian Fiete 2020-10-06 07:38:56 -07:00
parent 8376355098
commit 1171e6ef64
3 changed files with 33 additions and 11 deletions

View file

@ -1559,20 +1559,23 @@ BfBinaryOp Beefy::BfAssignOpToBinaryOp(BfAssignmentOp assignmentOp)
int Beefy::BfGetBinaryOpPrecendence(BfBinaryOp binOp)
{
switch (binOp)
{
case BfBinaryOp_LeftShift:
case BfBinaryOp_RightShift:
return 10;
{
case BfBinaryOp_Multiply:
case BfBinaryOp_Divide:
case BfBinaryOp_Modulus:
case BfBinaryOp_BitwiseAnd:
return 9;
case BfBinaryOp_Modulus:
return 13;
case BfBinaryOp_Add:
case BfBinaryOp_Subtract:
case BfBinaryOp_Subtract:
return 12;
case BfBinaryOp_LeftShift:
case BfBinaryOp_RightShift:
return 11;
case BfBinaryOp_BitwiseAnd:
return 10;
case BfBinaryOp_ExclusiveOr:
return 9;
case BfBinaryOp_BitwiseOr:
return 8;
return 8;
// "Range" inserted here if we were copying swift
case BfBinaryOp_Is:
case BfBinaryOp_As: