@@ -175,6 +175,12 @@ private List<string> GetData(object val, string key)
175
175
else
176
176
{
177
177
var valueArr = val as object [ ] ;
178
+ if ( valueArr == null )
179
+ {
180
+ // check if it is an array of strings
181
+ valueArr = val as string [ ] ;
182
+ }
183
+
178
184
if ( valueArr != null )
179
185
{
180
186
foreach ( var item in valueArr )
@@ -347,15 +353,46 @@ private Hashtable GetHashtableFromHashTableAst(HashtableAst hashTableAst)
347
353
if ( pipeAst != null )
348
354
{
349
355
ExpressionAst pureExp = pipeAst . GetPureExpression ( ) ;
350
- if ( pureExp is StringConstantExpressionAst )
356
+ var constExprAst = pureExp as ConstantExpressionAst ;
357
+ if ( constExprAst != null )
351
358
{
352
- rhsList . Add ( ( ( StringConstantExpressionAst ) pureExp ) . Value ) ;
359
+ var strConstExprAst = constExprAst as StringConstantExpressionAst ;
360
+ if ( strConstExprAst != null )
361
+ {
362
+ rhsList . Add ( strConstExprAst . Value ) ;
363
+ }
364
+ else
365
+ {
366
+ // it is either an integer or a float
367
+ output [ key ] = constExprAst . Value ;
368
+ continue ;
369
+ }
353
370
}
354
371
else if ( pureExp is HashtableAst )
355
372
{
356
373
output [ key ] = GetHashtableFromHashTableAst ( ( HashtableAst ) pureExp ) ;
357
374
continue ;
358
375
}
376
+ else if ( pureExp is VariableExpressionAst )
377
+ {
378
+ var varExprAst = ( VariableExpressionAst ) pureExp ;
379
+ switch ( varExprAst . VariablePath . UserPath . ToLower ( ) )
380
+ {
381
+ case "true" :
382
+ output [ key ] = true ;
383
+ break ;
384
+
385
+ case "false" :
386
+ output [ key ] = false ;
387
+ break ;
388
+
389
+ default :
390
+ ThrowInvalidDataException ( varExprAst . Extent ) ;
391
+ break ;
392
+ }
393
+
394
+ continue ;
395
+ }
359
396
else
360
397
{
361
398
rhsList = GetArrayFromAst ( pureExp ) ;
@@ -367,7 +404,7 @@ private Hashtable GetHashtableFromHashTableAst(HashtableAst hashTableAst)
367
404
ThrowInvalidDataException ( kvp . Item2 ) ;
368
405
}
369
406
370
- output [ key ] = rhsList ;
407
+ output [ key ] = rhsList . ToArray ( ) ;
371
408
}
372
409
373
410
return output ;
0 commit comments