예제 #1
0
파일: Binder.cs 프로젝트: marcfreir/blaster
        private BoundExpression BindUnaryExpression(UnaryExpressionSyntax expressionSyntax)
        {
            var boundOperand  = BindExpression(expressionSyntax.Operand);
            var boundOperator = BoundUnaryOperator.Bind(expressionSyntax.OperatorToken.Kind, boundOperand.Type);

            if (boundOperator == null)
            {
                _diagnostics.ReportUndefinedUnaryOperator(expressionSyntax.OperatorToken.Span, expressionSyntax.OperatorToken.Text, boundOperand.Type);
                return(boundOperand);
            }

            return(new BoundUnaryExpression(boundOperator, boundOperand));
        }
예제 #2
0
 public BoundUnaryExpression(BoundUnaryOperator operatorUnit, BoundExpression operand)
 {
     OperatorUnit = operatorUnit;
     Operand      = operand;
 }