コード例 #1
0
        internal SyntaxList <ArrayRankSpecifierSyntax> ConvertArrayRankSpecifierSyntaxes(
            SyntaxList <VBSyntax.ArrayRankSpecifierSyntax> arrayRankSpecifierSyntaxs,
            ArgumentListSyntax nodeArrayBounds, bool withSizes = true)
        {
            var bounds = SyntaxFactory.List(arrayRankSpecifierSyntaxs.Select(r => (ArrayRankSpecifierSyntax)r.Accept(_nodesVisitor)));

            if (nodeArrayBounds != null)
            {
                var sizesSpecified = nodeArrayBounds.Arguments.Any(a => !a.IsOmitted);
                var rank           = nodeArrayBounds.Arguments.Count;
                if (!sizesSpecified)
                {
                    rank += 1;
                }

                var convertedArrayBounds = withSizes && sizesSpecified?ConvertArrayBounds(nodeArrayBounds)
                                               : Enumerable.Repeat(SyntaxFactory.OmittedArraySizeExpression(), rank);

                var arrayRankSpecifierSyntax = SyntaxFactory.ArrayRankSpecifier(
                    SyntaxFactory.SeparatedList(
                        convertedArrayBounds));
                bounds = bounds.Insert(0, arrayRankSpecifierSyntax);
            }

            return(bounds);
        }
コード例 #2
0
        public IEnumerable <ExpressionSyntax> ConvertArrayBounds(ArgumentListSyntax argumentListSyntax)
        {
            return(argumentListSyntax.Arguments.Select(a => {
                VBSyntax.ExpressionSyntax upperBoundExpression = a is SimpleArgumentSyntax sas ? sas.Expression
                    : a is RangeArgumentSyntax ras ? ras.UpperBound
                    : throw new ArgumentOutOfRangeException(nameof(a), a, null);

                return IncreaseArrayUpperBoundExpression(upperBoundExpression);
            }));
        }
コード例 #3
0
 public static IEnumerable <ExpressionSyntax> ConvertArrayBounds(VBSyntax.ArgumentListSyntax argumentListSyntax, SemanticModel model, VBasic.VisualBasicSyntaxVisitor <CSharpSyntaxNode> commentConvertingNodesVisitor)
 {
     return(argumentListSyntax.Arguments.Select(a => IncreaseArrayUpperBoundExpression(((VBSyntax.SimpleArgumentSyntax)a).Expression, model, commentConvertingNodesVisitor)));
 }
コード例 #4
0
 public IEnumerable <ExpressionSyntax> ConvertArrayBounds(ArgumentListSyntax argumentListSyntax)
 {
     return(argumentListSyntax.Arguments.Select(a => IncreaseArrayUpperBoundExpression(((SimpleArgumentSyntax)a).Expression)));
 }
コード例 #5
0
 public virtual void VisitInvocationAndCreation(VBSyntax.ExpressionSyntax node,
                                                VBSyntax.ArgumentListSyntax argList,
                                                ExecutionState state,
                                                Configuration projectConfiguration)
 {
 }