|
1 | 1 | /****************************************************************************************************** |
2 | 2 | Title : ExpressionEvaluator (https://github.com/codingseb/ExpressionEvaluator) |
3 | | - Version : 1.4.27.0 |
| 3 | + Version : 1.4.28.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 |
@@ -38,6 +38,7 @@ public partial class ExpressionEvaluator |
38 | 38 | protected static readonly Regex stringBeginningRegex = new Regex("^(?<interpolated>[$])?(?<escaped>[@])?[\"]", RegexOptions.Compiled); |
39 | 39 | protected static readonly Regex internalCharRegex = new Regex(@"^['](\\[\\'0abfnrtv]|[^'])[']", RegexOptions.Compiled); |
40 | 40 | protected static readonly Regex indexingBeginningRegex = new Regex(@"^[?]?\[", RegexOptions.Compiled); |
| 41 | + protected static readonly Regex arrayTypeDetectionRegex = new Regex(@"^(\s*(\[(?>(?>\s+)|[,])*)\])+", RegexOptions.Compiled); |
41 | 42 | protected static readonly Regex assignationOrPostFixOperatorRegex = new Regex(@"^(?>\s*)((?<assignmentPrefix>[+\-*/%&|^]|<<|>>|\?\?)?=(?![=>])|(?<postfixOperator>([+][+]|--)(?![\p{L}_0-9])))"); |
42 | 43 | protected static readonly Regex genericsDecodeRegex = new Regex("(?<name>[^,<>]+)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?", RegexOptions.Compiled); |
43 | 44 | protected static readonly Regex genericsEndOnlyOneTrim = new Regex(@"(?>\s*)[>](?>\s*)$", RegexOptions.Compiled); |
@@ -2583,7 +2584,7 @@ protected virtual Type EvaluateType(string expression,ref int i, string currentN |
2583 | 2584 |
|
2584 | 2585 | Match arrayTypeMatch; |
2585 | 2586 |
|
2586 | | - if(i < expression.Length && (arrayTypeMatch = Regex.Match(expression.Substring(i), @"^(\s*(\[(?>(?>\s+)|[,])*)\])+")).Success) |
| 2587 | + if(i < expression.Length && (arrayTypeMatch = arrayTypeDetectionRegex.Match(expression.Substring(i))).Success) |
2587 | 2588 | { |
2588 | 2589 | Type arrayType = GetTypeByFriendlyName(staticType + arrayTypeMatch.Value); |
2589 | 2590 | if(arrayType != null) |
|
0 commit comments