@@ -2509,32 +2509,61 @@ protected virtual Type EvaluateType(string expression,ref int i, string currentN
2509
2509
Type staticType = GetTypeByFriendlyName ( typeName , genericsTypes ) ;
2510
2510
2511
2511
// For inline namespace parsing
2512
- if ( staticType == null && OptionInlineNamespacesEvaluationActive )
2512
+ if ( staticType == null )
2513
2513
{
2514
- int subIndex = 0 ;
2515
- Match namespaceMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2516
-
2517
- while ( staticType == null
2518
- && namespaceMatch . Success
2519
- && ! namespaceMatch . Groups [ "sign" ] . Success
2520
- && ! namespaceMatch . Groups [ "assignationOperator" ] . Success
2521
- && ! namespaceMatch . Groups [ "postfixOperator" ] . Success
2522
- && ! namespaceMatch . Groups [ "isfunction" ] . Success
2523
- && i + subIndex < expression . Length
2524
- && ! typeName . EndsWith ( "?" ) )
2514
+ if ( OptionInlineNamespacesEvaluationActive )
2525
2515
{
2526
- subIndex += namespaceMatch . Length ;
2527
- typeName += $ "{ namespaceMatch . Groups [ "inObject" ] . Value } { namespaceMatch . Groups [ "name" ] . Value } { ( ( i + subIndex < expression . Length && expression . Substring ( i + subIndex ) [ 0 ] == '?' ) ? "?" : "" ) } ";
2516
+ int subIndex = 0 ;
2517
+ Match namespaceMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2518
+
2519
+ while ( staticType == null
2520
+ && namespaceMatch . Success
2521
+ && ! namespaceMatch . Groups [ "sign" ] . Success
2522
+ && ! namespaceMatch . Groups [ "assignationOperator" ] . Success
2523
+ && ! namespaceMatch . Groups [ "postfixOperator" ] . Success
2524
+ && ! namespaceMatch . Groups [ "isfunction" ] . Success
2525
+ && i + subIndex < expression . Length
2526
+ && ! typeName . EndsWith ( "?" ) )
2527
+ {
2528
+ subIndex += namespaceMatch . Length ;
2529
+ typeName += $ "{ namespaceMatch . Groups [ "inObject" ] . Value } { namespaceMatch . Groups [ "name" ] . Value } { ( ( i + subIndex < expression . Length && expression . Substring ( i + subIndex ) [ 0 ] == '?' ) ? "?" : "" ) } ";
2528
2530
2529
- staticType = GetTypeByFriendlyName ( typeName , namespaceMatch . Groups [ "isgeneric" ] . Value ) ;
2531
+ staticType = GetTypeByFriendlyName ( typeName , namespaceMatch . Groups [ "isgeneric" ] . Value ) ;
2530
2532
2531
- if ( staticType != null )
2532
- {
2533
- i += subIndex ;
2534
- break ;
2533
+ if ( staticType != null )
2534
+ {
2535
+ i += subIndex ;
2536
+ break ;
2537
+ }
2538
+
2539
+ namespaceMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2535
2540
}
2541
+ }
2542
+ else
2543
+ {
2544
+ int subIndex = 0 ;
2545
+ Match typeMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2546
+
2547
+ if ( staticType == null
2548
+ && typeMatch . Success
2549
+ && ! typeMatch . Groups [ "sign" ] . Success
2550
+ && ! typeMatch . Groups [ "assignationOperator" ] . Success
2551
+ && ! typeMatch . Groups [ "postfixOperator" ] . Success
2552
+ && ! typeMatch . Groups [ "isfunction" ] . Success
2553
+ && ! typeMatch . Groups [ "inObject" ] . Success
2554
+ && i + subIndex < expression . Length
2555
+ && ! typeName . EndsWith ( "?" ) )
2556
+ {
2557
+ subIndex += typeMatch . Length ;
2558
+ typeName += $ "{ typeMatch . Groups [ "name" ] . Value } { ( ( i + subIndex < expression . Length && expression . Substring ( i + subIndex ) [ 0 ] == '?' ) ? "?" : "" ) } ";
2536
2559
2537
- namespaceMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2560
+ staticType = GetTypeByFriendlyName ( typeName , typeMatch . Groups [ "isgeneric" ] . Value ) ;
2561
+
2562
+ if ( staticType != null )
2563
+ {
2564
+ i += subIndex ;
2565
+ }
2566
+ }
2538
2567
}
2539
2568
}
2540
2569
0 commit comments