private static Node GetItemType(ArrayLiteralExpression value) { Node elementType = null; List <Node> elements = value.Elements; if (elements.Find(n => n.Kind == NodeKind.StringLiteral) != null) { elementType = NodeHelper.CreateNode(NodeKind.StringKeyword); } else if (elements.Find(n => n.Kind == NodeKind.TrueKeyword || n.Kind == NodeKind.FalseKeyword) != null) { elementType = NodeHelper.CreateNode(NodeKind.BooleanKeyword); } else if (elements.Find(n => n.Kind == NodeKind.NumericLiteral || (n.Kind == NodeKind.PrefixUnaryExpression && (n as PrefixUnaryExpression).Operand.Kind == NodeKind.NumericLiteral)) != null) { elementType = NodeHelper.CreateNode(NodeKind.NumberKeyword); } else if (elements.Count > 0) { foreach (Node element in elements) { Node type = GetNodeType(element); if (type != null) { elementType = type; break; } } } else if (elements.Count == 0 && value.Parent.Kind == NodeKind.ArrayLiteralExpression) { Node arrarrType = GetArrayLiteralType((ArrayLiteralExpression)value.Parent); if (arrarrType != null) { elementType = ((arrarrType as ArrayType).ElementType as ArrayType).ElementType; } } elementType = elementType ?? NodeHelper.CreateNode(NodeKind.AnyKeyword); elementType.NodeName = "elementType"; return(elementType); }