Пример #1
0
 public IfExpression(
     TextSpan span,
     DataType dataType,
     ExpressionSemantics semantics,
     IExpression condition,
     IBlockOrResult thenBlock,
     IElseClause?elseClause)
     : base(span, dataType, semantics)
 {
     Condition  = condition;
     ThenBlock  = thenBlock;
     ElseClause = elseClause;
 }
Пример #2
0
        /// <summary>
        /// Convert without expecting any result value
        /// </summary>
        private void Convert(IBlockOrResult blockOrResult)
        {
            switch (blockOrResult)
            {
            default:
                throw ExhaustiveMatch.Failed(blockOrResult);

            case IBlockExpression exp:
                Convert((IExpression)exp);
                break;

            case IResultStatement statement:
                Convert((IStatement)statement);
                break;
            }
        }