@@ -38,7 +38,11 @@ private static string[] ParseCsv(TextReader reader, ref int lineNum, char separa
38
38
if ( curChar . IsEol )
39
39
{
40
40
lineNum ++ ;
41
+ #if ! FW452
42
+ return Array . Empty < string > ( ) ;
43
+ #else
41
44
return Array < string > . Empty ;
45
+ #endif
42
46
}
43
47
44
48
var result = new List < string > ( ) ;
@@ -162,11 +166,15 @@ private static string[] ParseCsvNoEscape(TextReader reader, ref int lineNum, cha
162
166
var parts = line . Split ( separator ) ;
163
167
// Special case - whitespace lines are ignored
164
168
if ( parts . Length == 1 && parts [ 0 ] . IsNullOrWhiteSpace ( ) )
169
+ #if ! FW452
170
+ return Array . Empty < string > ( ) ;
171
+ #else
165
172
return Array < string > . Empty ;
173
+ #endif
166
174
return parts ;
167
175
}
168
176
169
- #region CharReader struct
177
+ #region CharReader struct
170
178
private struct CharReader
171
179
{
172
180
private const int s_Eof = - 1 ;
@@ -209,20 +217,20 @@ private static int Read(TextReader reader)
209
217
210
218
public CharReader Peek ( ) => new CharReader ( m_Reader , m_Reader . Peek ( ) ) ;
211
219
}
212
- #endregion
220
+ #endregion
213
221
214
- #region ParserState enum
222
+ #region ParserState enum
215
223
private enum ParserState
216
224
{
217
225
ExpectField ,
218
226
Field ,
219
227
QuotedField ,
220
228
AfterField
221
229
}
222
- #endregion
223
- #endregion
230
+ #endregion
231
+ #endregion
224
232
225
- #region Formatter
233
+ #region Formatter
226
234
/// <summary>
227
235
/// Creates formatter for CSV.
228
236
/// </summary>
@@ -278,7 +286,7 @@ public string FormatLine(string[] values, int[] columnWidths)
278
286
279
287
private class CsvNoEscapeFormatter : ITableDataFormatter
280
288
{
281
- #region Implementation of ITableDataFormatter
289
+ #region Implementation of ITableDataFormatter
282
290
/// <summary>
283
291
/// Returns length of formatted value.
284
292
/// </summary>
@@ -296,8 +304,8 @@ public string FormatLine(string[] values, int[] columnWidths) =>
296
304
values
297
305
. Zip ( columnWidths , ( s , w ) => s . PadLeft ( w ) )
298
306
. Join ( ", " ) ;
299
- #endregion
307
+ #endregion
300
308
}
301
- #endregion
309
+ #endregion
302
310
}
303
311
}
0 commit comments