private static void EmitUnaryBooleanExpression(UnaryBooleanExpression unaryBoolean, ILGenerator methodIL) { switch (unaryBoolean.OperatorKind) { case UnaryExpression.UnaryOperator.UnaryInversion: EmitExpression(unaryBoolean.Operand, methodIL); EmitInversion(methodIL); break; default: throw new Exception(); } }
public static InnerType ResolveUnaryBooleanExpressionType(UnaryBooleanExpression unaryBooleanExpression) { InnerType OperandType = ResolveExpressionType(unaryBooleanExpression.Operand); //try to cast switch (unaryBooleanExpression.OperatorKind) { case UnaryArithExpression.UnaryOperator.UnaryInversion: if (OperandType is Boolean) { return(OperandType); } ReportErrorInBooleanExpression(new SemanticErrorMessage($"Operator of logical inversion must be located before logical operand", unaryBooleanExpression.SourceContext)); return(OperandType); default: return(new Undefined()); } }
public static void TryToCastUnaryBooleanExpression(UnaryBooleanExpression unaryBoolean) { TryToCastExpression(unaryBoolean.Operand, new Undefined()); }