Skip to content

Commit 5fabd69

Browse files
committed
Some other stuff for a great version 1.4.28.0
1 parent 4b41d04 commit 5fabd69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************************************
22
Title : ExpressionEvaluator (https://github.com/codingseb/ExpressionEvaluator)
3-
Version : 1.4.27.0
3+
Version : 1.4.28.0
44
(if last digit (the forth) is not a zero, the version is an intermediate version and can be unstable)
55
66
Author : Coding Seb
@@ -38,6 +38,7 @@ public partial class ExpressionEvaluator
3838
protected static readonly Regex stringBeginningRegex = new Regex("^(?<interpolated>[$])?(?<escaped>[@])?[\"]", RegexOptions.Compiled);
3939
protected static readonly Regex internalCharRegex = new Regex(@"^['](\\[\\'0abfnrtv]|[^'])[']", RegexOptions.Compiled);
4040
protected static readonly Regex indexingBeginningRegex = new Regex(@"^[?]?\[", RegexOptions.Compiled);
41+
protected static readonly Regex arrayTypeDetectionRegex = new Regex(@"^(\s*(\[(?>(?>\s+)|[,])*)\])+", RegexOptions.Compiled);
4142
protected static readonly Regex assignationOrPostFixOperatorRegex = new Regex(@"^(?>\s*)((?<assignmentPrefix>[+\-*/%&|^]|<<|>>|\?\?)?=(?![=>])|(?<postfixOperator>([+][+]|--)(?![\p{L}_0-9])))");
4243
protected static readonly Regex genericsDecodeRegex = new Regex("(?<name>[^,<>]+)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?", RegexOptions.Compiled);
4344
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
25832584

25842585
Match arrayTypeMatch;
25852586

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)
25872588
{
25882589
Type arrayType = GetTypeByFriendlyName(staticType + arrayTypeMatch.Value);
25892590
if(arrayType != null)

0 commit comments

Comments
 (0)