private static PythonOperationKind PythonOperatorToAction(PythonOperator op) {
switch (op) {
// Binary
case PythonOperator.Add:
return PythonOperationKind.InPlaceAdd;
case PythonOperator.Subtract:
return PythonOperationKind.InPlaceSubtract;
case PythonOperator.Multiply:
return PythonOperationKind.InPlaceMultiply;
case PythonOperator.Divide:
return PythonOperationKind.InPlaceDivide;
case PythonOperator.TrueDivide:
return PythonOperationKind.InPlaceTrueDivide;
case PythonOperator.Mod:
return PythonOperationKind.InPlaceMod;
case PythonOperator.BitwiseAnd:
return PythonOperationKind.InPlaceBitwiseAnd;
case PythonOperator.BitwiseOr:
return PythonOperationKind.InPlaceBitwiseOr;
case PythonOperator.Xor:
return PythonOperationKind.InPlaceExclusiveOr;
case PythonOperator.LeftShift:
return PythonOperationKind.InPlaceLeftShift;
case PythonOperator.RightShift:
return PythonOperationKind.InPlaceRightShift;
case PythonOperator.Power:
return PythonOperationKind.InPlacePower;
case PythonOperator.FloorDivide:
return PythonOperationKind.InPlaceFloorDivide;
default:
Debug.Assert(false, "Unexpected PythonOperator: " + op.ToString());
return PythonOperationKind.None;
}
}