コード例 #1
0
        private static ExpressionStatementTranslationUnit CreateReturnStatement(ReturnStatement helper, SemanticModel semanticModel)
        {
            if (helper.Expression == null)
            {
                // Void return
                return(ExpressionStatementTranslationUnit.CreateReturn());
            }

            var expression = new ExpressionTranslationUnitBuilder(helper.Expression, semanticModel).Build();

            return(ExpressionStatementTranslationUnit.CreateReturn(expression as ExpressionTranslationUnit));
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static ITranslationUnit BuildReturnStatementTranslationUnit()
 {
     return(ExpressionStatementTranslationUnit.CreateReturn());
 }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static ITranslationUnit BuildReturnStatementTranslationUnit(ITranslationUnit expression)
 {
     return(ExpressionStatementTranslationUnit.CreateReturn(expression as ExpressionTranslationUnit));
 }