Skip to content

Commit d49b69e

Browse files
committed
refactoring
1 parent 8bd62db commit d49b69e

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************************************
22
Title : ExpressionEvaluator (https://github.com/codingseb/ExpressionEvaluator)
3-
Version : 1.3.2.0
3+
Version : 1.3.2.1
44
(if last digit is not a zero, the version is an intermediate version and can be unstable)
55
66
Author : Coding Seb
@@ -489,6 +489,24 @@ private StringComparer StringComparerForCasing
489489
/// </summary>
490490
public bool OptionFluidPrefixingActive { get; set; } = true;
491491

492+
private bool optionInlineNamespacesEvaluationActive = true;
493+
494+
/// <summary>
495+
/// if <c>true</c> allow the use of inline namespace (Can be slow, and is less secure).
496+
/// if <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available).
497+
/// By default : true
498+
/// </summary>
499+
public bool OptionInlineNamespacesEvaluationActive
500+
{
501+
get { return optionInlineNamespacesEvaluationActive; }
502+
set
503+
{
504+
optionInlineNamespacesEvaluationActive = value;
505+
instanceCreationWithNewKeywordRegex = new Regex(InstanceCreationWithNewKeywordRegexPattern, (optionCaseSensitiveEvaluationActive ? RegexOptions.None : RegexOptions.IgnoreCase));
506+
castRegex = new Regex(CastRegexPattern, (optionCaseSensitiveEvaluationActive ? RegexOptions.None : RegexOptions.IgnoreCase));
507+
}
508+
}
509+
492510
private Func<ExpressionEvaluator, List<string>, object> newMethodMem;
493511

494512
/// <summary>
@@ -521,22 +539,6 @@ public bool OptionNewFunctionEvaluationActive
521539
/// </summary>
522540
public bool OptionNewKeywordEvaluationActive { get; set; } = true;
523541

524-
/// <summary>
525-
/// if <c>true</c> allow the use of inline namespace (Can be slow, and is less secure).
526-
/// if <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available).
527-
/// By default : true
528-
/// </summary>
529-
public bool OptionInlineNamespacesEvaluationActive
530-
{
531-
get { return optionInlineNamespacesEvaluationActive; }
532-
set
533-
{
534-
optionInlineNamespacesEvaluationActive = value;
535-
instanceCreationWithNewKeywordRegex = new Regex(InstanceCreationWithNewKeywordRegexPattern, (optionCaseSensitiveEvaluationActive ? RegexOptions.None : RegexOptions.IgnoreCase));
536-
castRegex = new Regex(CastRegexPattern, (optionCaseSensitiveEvaluationActive ? RegexOptions.None : RegexOptions.IgnoreCase));
537-
}
538-
}
539-
540542
/// <summary>
541543
/// if <c>true</c> allow to call static methods on classes.
542544
/// if <c>false</c> unactive this functionality.
@@ -714,7 +716,7 @@ public ExpressionEvaluator(Dictionary<string, object> variables) : this()
714716
#region Main evaluate methods (Expressions and scripts ==> public)
715717

716718
private bool inScript = false;
717-
private bool optionInlineNamespacesEvaluationActive = true;
719+
718720

719721
/// <summary>
720722
/// Evaluate a script (multiple expressions separated by semicolon)

0 commit comments

Comments
 (0)