Пример #1
0
        private static string GetLabelNamePart(LabelExpression label, ITranslationContext context)
        {
            if (context.IsReferencedByGoto(label.Target))
            {
                return(label.Target.Name.IsNullOrWhiteSpace() ? null : label.Target.Name);
            }

            return(null);
        }
        private static bool Include(Expression expression, BlockExpression block, ITranslationContext context)
        {
            switch (expression.NodeType)
            {
            case Label:
                return(expression.HasReturnType() ||
                       context.IsReferencedByGoto(((LabelExpression)expression).Target));

            case Default when !expression.HasReturnType():
                return(false);
            }

            if (expression == block.Result)
            {
                return(true);
            }

            if (expression.NodeType == Parameter)
            {
                return(false);
            }

            return((expression.NodeType != Constant) || expression.IsComment());
        }