Beispiel #1
0
        public override Ust VisitInitializerExpression(InitializerExpressionSyntax node)
        {
            var children = node.Expressions.Select(e => (Expression)VisitAndReturnNullIfError(e))
                           .ToArray();

            var result = new MultichildExpression(children, node.GetTextSpan());

            return(result);
        }
Beispiel #2
0
        public override Ust VisitInitializerExpression(InitializerExpressionSyntax node)
        {
            Ust result   = null;
            var children = node.Expressions.Select(e => (Expression)VisitAndReturnNullIfError(e))
                           .ToArray();
            var textSpan = node.GetTextSpan();

            if (node.Kind() == SyntaxKind.ArrayInitializerExpression)
            {
                var sizes = new List <Expression> {
                    new IntLiteral(children.Length)
                };
                result = new ArrayCreationExpression(new TypeToken("", textSpan), sizes, children.ToList(), textSpan);
            }
            else
            {
                result = new MultichildExpression(children, textSpan);
            }

            return(result);
        }