|
1 | 1 | /******************************************************************************************************
|
2 | 2 | Title : ExpressionEvaluator (https://github.com/codingseb/ExpressionEvaluator)
|
3 |
| - Version : 1.4.24.0 |
| 3 | + Version : 1.4.26.0 |
4 | 4 | (if last digit (the forth) is not a zero, the version is an intermediate version and can be unstable)
|
5 | 5 |
|
6 | 6 | Author : Coding Seb
|
@@ -2442,6 +2442,7 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
|
2442 | 2442 | string typeName = $"{varFuncName}{((i < expression.Length && expression.Substring(i)[0] == '?') ? "?" : "") }";
|
2443 | 2443 | Type staticType = GetTypeByFriendlyName(typeName, genericsTypes);
|
2444 | 2444 |
|
| 2445 | + // For inline namespace parsing |
2445 | 2446 | if (staticType == null && OptionInlineNamespacesEvaluationActive)
|
2446 | 2447 | {
|
2447 | 2448 | int subIndex = 0;
|
@@ -2471,6 +2472,38 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
|
2471 | 2472 | }
|
2472 | 2473 | }
|
2473 | 2474 |
|
| 2475 | + // For nested type parsing |
| 2476 | + if (staticType != null) |
| 2477 | + { |
| 2478 | + int subIndex = 0; |
| 2479 | + Match nestedTypeMatch = varOrFunctionRegEx.Match(expression.Substring(i + subIndex)); |
| 2480 | + Type nestedType = null; |
| 2481 | + |
| 2482 | + while (nestedTypeMatch.Success |
| 2483 | + && !nestedTypeMatch.Groups["sign"].Success |
| 2484 | + && !nestedTypeMatch.Groups["assignationOperator"].Success |
| 2485 | + && !nestedTypeMatch.Groups["postfixOperator"].Success |
| 2486 | + && !nestedTypeMatch.Groups["isfunction"].Success |
| 2487 | + && i + nestedTypeMatch.Length < expression.Length) |
| 2488 | + { |
| 2489 | + typeName += $"+{nestedTypeMatch.Groups["name"].Value}"; |
| 2490 | + |
| 2491 | + nestedType = GetTypeByFriendlyName(typeName, nestedTypeMatch.Groups["isgeneric"].Value); |
| 2492 | + |
| 2493 | + if (nestedType != null) |
| 2494 | + { |
| 2495 | + i += nestedTypeMatch.Length; |
| 2496 | + staticType = nestedType; |
| 2497 | + } |
| 2498 | + else |
| 2499 | + { |
| 2500 | + break; |
| 2501 | + } |
| 2502 | + |
| 2503 | + nestedTypeMatch = varOrFunctionRegEx.Match(expression.Substring(i + subIndex)); |
| 2504 | + } |
| 2505 | + } |
| 2506 | + |
2474 | 2507 | if (typeName.EndsWith("?") && staticType != null)
|
2475 | 2508 | i++;
|
2476 | 2509 |
|
|
0 commit comments