From 2be5ed47bf05e0463865d76e27ebf42082216682 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Thu, 7 Jan 2021 13:27:32 +0100
Subject: [PATCH 01/48] ManageJumpStatementsOrExpressionEval Refactoring

---
 .../ExpressionEvaluator.cs                    | 90 +++++++++++--------
 1 file changed, 51 insertions(+), 39 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index ffe4476..7513c95 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -999,46 +999,13 @@ protected virtual object ScriptEvaluate(string script, ref bool valueReturned, r
 
             script = script.TrimEnd();
 
-            object ManageJumpStatementsOrExpressionEval(string expression)
-            {
-                expression = expression.Trim();
-
-                if (expression.Equals("break", StringComparisonForCasing))
-                {
-                    isBreak = true;
-                    return lastResult;
-                }
-
-                if (expression.Equals("continue", StringComparisonForCasing))
-                {
-                    isContinue = true;
-                    return lastResult;
-                }
-
-                if (expression.StartsWith("throw ", StringComparisonForCasing))
-                {
-                    throw Evaluate(expression.Remove(0, 6)) as Exception;
-                }
-
-                expression = returnKeywordRegex.Replace(expression, match =>
-                {
-                    if (OptionCaseSensitiveEvaluationActive && !match.Value.StartsWith("return"))
-                        return match.Value;
-
-                    isReturn = true;
-                    return match.Value.Contains("(") ? "(" : string.Empty;
-                });
-
-                return Evaluate(expression);
-            }
-
             object ScriptExpressionEvaluate(ref int index)
             {
                 string expression = script.Substring(startOfExpression, index - startOfExpression);
 
                 startOfExpression = index + 1;
 
-                return ManageJumpStatementsOrExpressionEval(expression);
+                return ManageJumpStatementsOrExpressionEval(expression, ref isBreak, ref isContinue, ref isReturn, lastResult);
             }
 
             bool TryParseStringAndParenthisAndCurlyBrackets(ref int index)
@@ -1078,7 +1045,7 @@ void ExecuteIfList()
             {
                 if (ifElseStatementsList.Count > 0)
                 {
-                    string ifScript = ifElseStatementsList.Find(statement => (bool)ManageJumpStatementsOrExpressionEval(statement[0]))?[1];
+                    string ifScript = ifElseStatementsList.Find(statement => (bool)ManageJumpStatementsOrExpressionEval(statement[0], ref isBreak, ref isContinue, ref isReturn, lastResult) )?[1];
 
                     if (!string.IsNullOrEmpty(ifScript))
                         lastResult = ScriptEvaluate(ifScript, ref isReturn, ref isBreak, ref isContinue);
@@ -1300,7 +1267,7 @@ void ExecuteBlocksStacks()
                                             isContinue = false;
                                         }
                                     }
-                                    while (!isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[0]));
+                                    while (!isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[0], ref isBreak, ref isContinue, ref isReturn, lastResult));
                                 }
                                 else
                                 {
@@ -1314,7 +1281,7 @@ void ExecuteBlocksStacks()
                         }
                         else if (keyword.Equals("while", StringComparisonForCasing))
                         {
-                            while (!isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[0]))
+                            while (!isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[0], ref isBreak, ref isContinue, ref isReturn, lastResult))
                             {
                                 lastResult = ScriptEvaluate(subScript, ref isReturn, ref isBreak, ref isContinue);
 
@@ -1334,10 +1301,10 @@ void ExecuteBlocksStacks()
                             void forAction(int index)
                             {
                                 if (keywordAttributes.Count > index && !keywordAttributes[index].Trim().Equals(string.Empty))
-                                    ManageJumpStatementsOrExpressionEval(keywordAttributes[index]);
+                                    ManageJumpStatementsOrExpressionEval(keywordAttributes[index], ref isBreak, ref isContinue, ref isReturn, lastResult);
                             }
 
-                            for (forAction(0); !isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[1]); forAction(2))
+                            for (forAction(0); !isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[1], ref isBreak, ref isContinue, ref isReturn, lastResult); forAction(2))
                             {
                                 lastResult = ScriptEvaluate(subScript, ref isReturn, ref isBreak, ref isContinue);
 
@@ -1504,6 +1471,49 @@ public object Evaluate(string expression)
 
         #region Sub parts evaluate methods (protected virtual)
 
+        #region Scripts
+
+        protected virtual object ManageJumpStatementsOrExpressionEval(string expression, ref bool isBreak, ref bool isContinue, ref bool isReturn, object lastResult)
+        {
+            expression = expression.Trim();
+
+            if (expression.Equals("break", StringComparisonForCasing))
+            {
+                isBreak = true;
+                return lastResult;
+            }
+
+            if (expression.Equals("continue", StringComparisonForCasing))
+            {
+                isContinue = true;
+                return lastResult;
+            }
+
+            if (expression.StartsWith("throw ", StringComparisonForCasing))
+            {
+                throw Evaluate(expression.Remove(0, 6)) as Exception;
+            }
+
+            bool ret = isReturn;
+
+            expression = returnKeywordRegex.Replace(expression, match =>
+            {
+                if (OptionCaseSensitiveEvaluationActive && !match.Value.StartsWith("return"))
+                    return match.Value;
+
+                ret = true;
+                return match.Value.Contains("(") ? "(" : string.Empty;
+            });
+
+            isReturn = ret;
+
+            return Evaluate(expression);
+        }
+
+        #endregion
+
+        #region Expressions
+
         protected virtual bool EvaluateCast(string expression, Stack<object> stack, ref int i)
         {
             Match castMatch = Regex.Match(expression.Substring(i), CastRegexPattern, optionCaseSensitiveEvaluationActive ? RegexOptions.None : RegexOptions.IgnoreCase);
@@ -2770,6 +2780,8 @@ protected virtual bool EvaluateString(string expression, Stack<object> stack, re
 
         #endregion
 
+        #endregion
+
         #region ProcessStack
 
         protected virtual object ProcessStack(Stack<object> stack)

From 03a93516b79fb477f4b540f2c530cb705e6ae039 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 8 Jan 2021 15:39:05 +0100
Subject: [PATCH 02/48] In progress

---
 .../ExpressionEvaluator.cs                    | 258 +++++++++---------
 1 file changed, 134 insertions(+), 124 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 4b075ed..ad4a0c5 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -75,7 +75,7 @@ public partial class ExpressionEvaluator
 
         #endregion
 
-        #region enums (if else blocks states)
+        #region enums 
 
         protected enum IfBlockEvaluatedState
         {
@@ -93,7 +93,7 @@ protected enum TryBlockEvaluatedState
 
         #endregion
 
-        #region Dictionaries declarations (Primary types, number suffix, escaped chars, operators management, default vars and functions)
+        #region Dictionaries declarations (Primary types, number suffix, escaped chars, operators management, keywords management, default vars and functions)
 
         protected static readonly IDictionary<string, Type> primaryTypesDict = new Dictionary<string, Type>()
         {
@@ -1040,132 +1040,19 @@ protected virtual object ScriptEvaluate(string script, ref bool valueReturned, r
 
             script = script.TrimEnd();
 
-            object ScriptExpressionEvaluate(ref int index)
-            {
-                string expression = script.Substring(startOfExpression, index - startOfExpression);
-
-                startOfExpression = index + 1;
-
-                return ManageJumpStatementsOrExpressionEval(expression, ref isBreak, ref isContinue, ref isReturn, lastResult);
-            }
-
-            bool TryParseStringAndParenthisAndCurlyBrackets(ref int index)
-            {
-                bool parsed = true;
-                Match internalStringMatch = stringBeginningRegex.Match(script.Substring(index));
-
-                if (internalStringMatch.Success)
-                {
-                    string innerString = internalStringMatch.Value + GetCodeUntilEndOfString(script.Substring(index + internalStringMatch.Length), internalStringMatch);
-                    index += innerString.Length - 1;
-                }
-                else if (script[index] == '(')
-                {
-                    index++;
-                    GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref index, false);
-                }
-                else if (script[index] == '{')
-                {
-                    index++;
-                    GetScriptBetweenCurlyBrackets(script, ref index);
-                }
-                else
-                {
-                    Match charMatch = internalCharRegex.Match(script.Substring(index));
-
-                    if (charMatch.Success)
-                        index += charMatch.Length;
-
-                    parsed = false;
-                }
-
-                return parsed;
-            }
-
-            void ExecuteIfList()
-            {
-                if (ifElseStatementsList.Count > 0)
-                {
-                    string ifScript = ifElseStatementsList.Find(statement => (bool)ManageJumpStatementsOrExpressionEval(statement[0], ref isBreak, ref isContinue, ref isReturn, lastResult) )?[1];
-
-                    if (!string.IsNullOrEmpty(ifScript))
-                        lastResult = ScriptEvaluate(ifScript, ref isReturn, ref isBreak, ref isContinue);
-
-                    ifElseStatementsList.Clear();
-                }
-            }
-
-            void ExecuteTryList()
-            {
-                if (tryStatementsList.Count > 0)
-                {
-                    if (tryStatementsList.Count == 1)
-                    {
-                        throw new ExpressionEvaluatorSyntaxErrorException("a try statement need at least one catch or one finally statement.");
-                    }
-
-                    try
-                    {
-                        lastResult = ScriptEvaluate(tryStatementsList[0][0], ref isReturn, ref isBreak, ref isContinue);
-                    }
-                    catch (Exception exception)
-                    {
-                        bool atLeasOneCatch = false;
-
-                        foreach (List<string> catchStatement in tryStatementsList.Skip(1).TakeWhile(e => e[0].Equals("catch")))
-                        {
-                            if (catchStatement[1] != null)
-                            {
-                                string[] exceptionVariable = catchStatement[1].Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
-
-                                string exceptionName = exceptionVariable[0];
-
-                                if (exceptionVariable.Length >= 2)
-                                {
-                                    if (!((ClassOrEnumType)Evaluate(exceptionVariable[0])).Type.IsAssignableFrom(exception.GetType()))
-                                        continue;
-
-                                    exceptionName = exceptionVariable[1];
-                                }
-
-                                Variables[exceptionName] = exception;
-                            }
-
-                            lastResult = ScriptEvaluate(catchStatement[2], ref isReturn, ref isBreak, ref isContinue);
-                            atLeasOneCatch = true;
-                            break;
-                        }
-
-                        if (!atLeasOneCatch)
-                        {
-                            throw;
-                        }
-                    }
-                    finally
-                    {
-                        if (tryStatementsList.Last()[0].Equals("finally"))
-                        {
-                            lastResult = ScriptEvaluate(tryStatementsList.Last()[1], ref isReturn, ref isBreak, ref isContinue);
-                        }
-                    }
-
-                    tryStatementsList.Clear();
-                }
-            }
-
             void ExecuteBlocksStacks()
             {
-                ExecuteTryList();
-                ExecuteIfList();
+                ExecuteTryList(tryStatementsList, ref isBreak, ref isContinue, ref isReturn, ref lastResult);
+                ExecuteIfList(ifElseStatementsList, ref isBreak, ref isContinue, ref isReturn, ref lastResult);
             }
 
             int i = 0;
 
             while (!isReturn && !isBreak && !isContinue && i < script.Length)
             {
-                Match blockKeywordsBeginingMatch = null;
                 Match blockKeywordsWithoutParenthesesBeginningMatch = null;
 
+                Match blockKeywordsBeginingMatch;
                 if (script.Substring(startOfExpression, i - startOfExpression).Trim().Equals(string.Empty)
                     && ((blockKeywordsBeginingMatch = blockKeywordsBeginningRegex.Match(script.Substring(i))).Success
                         || (blockKeywordsWithoutParenthesesBeginningMatch = blockKeywordsWithoutParenthesesBeginningRegex.Match(script.Substring(i))).Success))
@@ -1196,8 +1083,8 @@ void ExecuteBlocksStacks()
 
                         while (i < script.Length && continueExpressionParsing)
                         {
-                            if (TryParseStringAndParenthisAndCurlyBrackets(ref i)) { }
-                            else if (script.Length - i > 2 && script.Substring(i, 3).Equals("';'"))
+                            if (TryParseStringAndParenthisAndCurlyBrackets(script, ref i)) { }
+                            else if (script.Length - i >= 3 && script.Substring(i, 3).Equals("';'"))
                             {
                                 i += 2;
                             }
@@ -1288,7 +1175,7 @@ void ExecuteBlocksStacks()
 
                                 i++;
 
-                                Match nextIsEndOfExpressionMatch = null;
+                                Match nextIsEndOfExpressionMatch;
 
                                 if ((nextIsEndOfExpressionMatch = nextIsEndOfExpressionRegex.Match(script.Substring(i))).Success)
                                 {
@@ -1402,21 +1289,21 @@ void forAction(int index)
 
                     bool executed = false;
 
-                    if (TryParseStringAndParenthisAndCurlyBrackets(ref i)) { }
+                    if (TryParseStringAndParenthisAndCurlyBrackets(script, ref i)) { }
                     else if (script.Length - i > 2 && script.Substring(i, 3).Equals("';'"))
                     {
                         i += 2;
                     }
                     else if (script[i] == ';')
                     {
-                        lastResult = ScriptExpressionEvaluate(ref i);
+                        lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
                         executed = true;
                     }
 
                     if (!OptionScriptNeedSemicolonAtTheEndOfLastExpression && i == script.Length - 1 && !executed)
                     {
                         i++;
-                        lastResult = ScriptExpressionEvaluate(ref i);
+                        lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
                         startOfExpression--;
                     }
 
@@ -1521,6 +1408,15 @@ public object Evaluate(string expression)
 
         #region Scripts
 
+        protected virtual object ScriptExpressionEvaluate(string script, ref int startOfExpression, ref int index, ref bool isBreak, ref bool isContinue, ref bool isReturn, object lastResult)
+        {
+            string expression = script.Substring(startOfExpression, index - startOfExpression);
+
+            startOfExpression = index + 1;
+
+            return ManageJumpStatementsOrExpressionEval(expression, ref isBreak, ref isContinue, ref isReturn, lastResult);
+        }
+
         protected virtual object ManageJumpStatementsOrExpressionEval(string expression, ref bool isBreak, ref bool isContinue, ref bool isReturn, object lastResult)
         {
             expression = expression.Trim();
@@ -1558,6 +1454,120 @@ protected virtual object ManageJumpStatementsOrExpressionEval(string expression,
             return Evaluate(expression);
         }
 
+        protected virtual bool TryParseStringAndParenthisAndCurlyBrackets(string script, ref int index)
+        {
+            bool parsed = true;
+            Match internalStringMatch = stringBeginningRegex.Match(script.Substring(index));
+
+            if (internalStringMatch.Success)
+            {
+                string innerString = internalStringMatch.Value + GetCodeUntilEndOfString(script.Substring(index + internalStringMatch.Length), internalStringMatch);
+                index += innerString.Length - 1;
+            }
+            else if (script[index] == '(')
+            {
+                index++;
+                GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref index, false);
+            }
+            else if (script[index] == '{')
+            {
+                index++;
+                GetScriptBetweenCurlyBrackets(script, ref index);
+            }
+            else
+            {
+                Match charMatch = internalCharRegex.Match(script.Substring(index));
+
+                if (charMatch.Success)
+                    index += charMatch.Length;
+
+                parsed = false;
+            }
+
+            return parsed;
+        }
+
+        protected virtual void ExecuteIfList(List<List<string>> ifElseStatementsList, ref bool isBreak, ref bool isContinue, ref bool isReturn, ref object lastResult)
+        {
+            if (ifElseStatementsList.Count > 0)
+            {
+                bool tmpBreak = isBreak;
+                bool tmpContinue = isContinue;
+                bool tmpReturn = isReturn;
+                object tmpLastResult = lastResult;
+
+                string ifScript = ifElseStatementsList.Find(statement => (bool)ManageJumpStatementsOrExpressionEval(statement[0], ref tmpBreak, ref tmpContinue, ref tmpReturn, tmpLastResult))?[1];
+
+                isBreak = tmpBreak;
+                isContinue = tmpContinue;
+                isReturn = tmpReturn;
+                lastResult = tmpLastResult;
+
+                if (!string.IsNullOrEmpty(ifScript))
+                    lastResult = ScriptEvaluate(ifScript, ref isReturn, ref isBreak, ref isContinue);
+
+                ifElseStatementsList.Clear();
+            }
+        }
+
+        protected virtual void ExecuteTryList(List<List<string>> tryStatementsList, ref bool isBreak, ref bool isContinue, ref bool isReturn, ref object lastResult)
+        {
+            if (tryStatementsList.Count > 0)
+            {
+                if (tryStatementsList.Count == 1)
+                {
+                    throw new ExpressionEvaluatorSyntaxErrorException("a try statement need at least one catch or one finally statement.");
+                }
+
+                try
+                {
+                    lastResult = ScriptEvaluate(tryStatementsList[0][0], ref isReturn, ref isBreak, ref isContinue);
+                }
+                catch (Exception exception)
+                {
+                    bool atLeasOneCatch = false;
+
+                    foreach (List<string> catchStatement in tryStatementsList.Skip(1).TakeWhile(e => e[0].Equals("catch")))
+                    {
+                        if (catchStatement[1] != null)
+                        {
+                            string[] exceptionVariable = catchStatement[1].Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
+
+                            string exceptionName = exceptionVariable[0];
+
+                            if (exceptionVariable.Length >= 2)
+                            {
+                                if (!((ClassOrEnumType)Evaluate(exceptionVariable[0])).Type.IsAssignableFrom(exception.GetType()))
+                                    continue;
+
+                                exceptionName = exceptionVariable[1];
+                            }
+
+                            Variables[exceptionName] = exception;
+                        }
+
+                        lastResult = ScriptEvaluate(catchStatement[2], ref isReturn, ref isBreak, ref isContinue);
+                        atLeasOneCatch = true;
+                        break;
+                    }
+
+                    if (!atLeasOneCatch)
+                    {
+                        throw;
+                    }
+                }
+                finally
+                {
+                    if (tryStatementsList.Last()[0].Equals("finally"))
+                    {
+                        lastResult = ScriptEvaluate(tryStatementsList.Last()[1], ref isReturn, ref isBreak, ref isContinue);
+                    }
+                }
+
+                tryStatementsList.Clear();
+            }
+        }
+
         #endregion
 
         #region Expressions

From a48ef7139cc7d288dab38b29044389793f97f511 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Mon, 11 Jan 2021 13:14:10 +0100
Subject: [PATCH 03/48] In progress

---
 .../ExpressionEvaluator.cs                    | 65 ++++++++++++++++++-
 1 file changed, 64 insertions(+), 1 deletion(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index ad4a0c5..a72baf0 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -10,6 +10,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.Dynamic;
 using System.Globalization;
@@ -66,13 +67,21 @@ public partial class ExpressionEvaluator
         protected static readonly Regex newLineCharsRegex = new Regex(@"\r\n|\r|\n", RegexOptions.Compiled);
 
         // For script only
-        protected static readonly Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)[(]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+        protected Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)[(]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockKeywordsWithoutParenthesesBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
         protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s*)|\()", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
         protected static readonly Regex nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)[;]", RegexOptions.Compiled);
 
+        /// <summary>
+        /// Rebuild some Regex to detect blocks keywords in script
+        /// </summary>
+        protected void RefreshBlocksKeywordDetection()
+        {
+            blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket), RegexOptions.IgnoreCase | RegexOptions.Compiled);
+        }
+
         #endregion
 
         #region enums 
@@ -469,6 +478,11 @@ protected static object IndexingOperatorFunc(dynamic left, dynamic right)
             { "typeof", (self, args) => ((ClassOrEnumType)self.Evaluate(args[0])).Type },
         };
 
+        //protected readonly ObservableCollection<ScriptBlocksKeyword> scriptBlocksKeywords = new ObservableCollection<ScriptBlocksKeyword>()
+        //{
+
+        //};
+
         #endregion
 
         #region Caching
@@ -828,6 +842,45 @@ public bool OptionNewFunctionEvaluationActive
         /// </summary>
         public bool OptionScriptNeedSemicolonAtTheEndOfLastExpression { get; set; } = true;
 
+        private string optionScriptBlocksKeywordsHeadStatementsStartBracket = "(";
+        /// <summary>
+        /// To specify the character or string that begin the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
+        /// By default : <c>"("</c>
+        /// </summary>
+        public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
+        {
+            get { return optionScriptBlocksKeywordsHeadStatementsStartBracket; }
+            set
+            {
+                optionScriptBlocksKeywordsHeadStatementsStartBracket = value;
+                RefreshBlocksKeywordDetection();
+            }
+        }
+
+        /// <summary>
+        /// To specify the character or string that end the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
+        /// By default : <c>")"</c>
+        /// </summary>
+        public string OptionScriptBlocksKeywordsHeadStatementsEndBracket { get; set; } = ")";
+
+        /// <summary>
+        /// To specify the character or string that separate the head statements and the block statements of script blocks keywords (if, else if, for, foreach while, do.. while)
+        /// By default : <c>":"</c>
+        /// </summary>
+        public string OptionScriptBlockKeywordsHeadStatementsAndBlockSeparator { get; set; } = ":";
+
+        /// <summary>
+        /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
+        /// By default : "{"
+        /// </summary>
+        public string OptionScriptBlockStartBrackets { get; set; } = "{";
+
+        /// <summary>
+        /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
+        /// By default : "}"
+        /// </summary>
+        public string OptionScriptBlockEndBrackets { get; set; } = "}";
+
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)
         /// If <c>false</c> Allow to access only to public members.
@@ -3929,6 +3982,16 @@ public bool Equals(ExpressionOperator otherOperator)
         }
     }
 
+    public partial class ScriptBlocksKeyword
+    {
+        public ScriptBlocksKeyword(string name)
+        {
+            Name = name;
+        }
+
+        public string Name { get; set; }
+    }
+
     public static partial class OperatorsEvaluationsExtensions
     {
         public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> Copy(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations)

From 0d90c9d7b1d3964d40cb7010cb769183d9a84e94 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Mon, 11 Jan 2021 15:40:37 +0100
Subject: [PATCH 04/48] Make brackets more flexibles

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs |  7 ++
 .../Resources.Designer.cs                     | 12 ++++
 .../Resources.resx                            |  3 +
 .../Resources/Script0072.txt                  |  4 ++
 .../ExpressionEvaluator.cs                    | 65 ++++++++++---------
 5 files changed, 61 insertions(+), 30 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0072.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 8a7e010..f27598e 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1076,6 +1076,13 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("variable assignation")
                     .Returns(2);
 
+                yield return new TestCaseData(Resources.Script0072, null, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("return")
+                    .SetCategory("parentheses")
+                    .SetCategory("variable assignation")
+                    .Returns(8);
+
                 ExpressionEvaluator evaluator = new ExpressionEvaluator()
                 {
                     OptionOnNoReturnKeywordFoundInScriptAction = OptionOnNoReturnKeywordFoundInScriptAction.ReturnNull
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index 516cc57..db9b2fc 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1244,5 +1244,17 @@ public static string Script0071 {
                 return ResourceManager.GetString("Script0071", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0072 */
+        ///var myVar = 8;
+        ///
+        ///return (myVar);.
+        /// </summary>
+        public static string Script0072 {
+            get {
+                return ResourceManager.GetString("Script0072", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index b678fca..1f55641 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -331,4 +331,7 @@
   <data name="Script0071" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0071.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0072" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0072.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0072.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0072.txt
new file mode 100644
index 0000000..8fb7546
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0072.txt
@@ -0,0 +1,4 @@
+﻿/* Script0072 */
+var myVar = 8;
+
+return( myVar );
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index a72baf0..4cfa98f 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -71,7 +71,7 @@ public partial class ExpressionEvaluator
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockKeywordsWithoutParenthesesBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
-        protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s*)|\()", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
+        protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s+)|(?=\())", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
         protected static readonly Regex nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)[;]", RegexOptions.Compiled);
 
         /// <summary>
@@ -478,6 +478,17 @@ protected static object IndexingOperatorFunc(dynamic left, dynamic right)
             { "typeof", (self, args) => ((ClassOrEnumType)self.Evaluate(args[0])).Type },
         };
 
+        /// <summary>
+        /// Specify for each possible imbricable type of opening brackets the corresponding closing bracket
+        /// By default : { "(" : ")", "{" : "}", "[", "]" }
+        /// </summary>
+        public IDictionary<string, string> ImbricableBracketsPairing { get; } = new Dictionary<string, string>()
+        {
+            { "(", ")" },
+            { "{", "}" },
+            { "[", "]" },
+        };
+
         //protected readonly ObservableCollection<ScriptBlocksKeyword> scriptBlocksKeywords = new ObservableCollection<ScriptBlocksKeyword>()
         //{
 
@@ -1499,7 +1510,7 @@ protected virtual object ManageJumpStatementsOrExpressionEval(string expression,
                     return match.Value;
 
                 ret = true;
-                return match.Value.Contains("(") ? "(" : string.Empty;
+                return string.Empty;
             });
 
             isReturn = ret;
@@ -3399,7 +3410,7 @@ protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref
             return currentScript;
         }
 
-        protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(string expression, ref int i, bool checkSeparator, string separator = ",", string startChar = "(", string endChar = ")")
+        protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(string expression, ref int i, bool checkSeparator, string separator = ",", string startToken = "(", string endToken = ")")
         {
             List<string> expressionsList = new List<string>();
 
@@ -3425,32 +3436,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                 }
                 else
                 {
-                    s = expression.Substring(i, 1);
-
-                    if (s.Equals(startChar))
-                    {
-                        bracketCount++;
-                    }
-                    else if (s.Equals("("))
-                    {
-                        i++;
-                        currentExpression += "(" + GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, false, ",", "(", ")").SingleOrDefault() + ")";
-                        continue;
-                    }
-                    else if (s.Equals("{"))
-                    {
-                        i++;
-                        currentExpression += "{" + GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, false, ",", "{", "}").SingleOrDefault() + "}";
-                        continue;
-                    }
-                    else if (s.Equals("["))
-                    {
-                        i++;
-                        currentExpression += "[" + GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, false, ",", "[", "]").SingleOrDefault() + "]";
-                        continue;
-                    }
-
-                    if (s.Equals(endChar))
+                    if (expression.Substring(i).StartsWith(endToken, StringComparisonForCasing))
                     {
                         bracketCount--;
                         if (bracketCount == 0)
@@ -3461,6 +3447,25 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                         }
                     }
 
+                    if (expression.Substring(i).StartsWith(startToken, StringComparisonForCasing))
+                    {
+                        bracketCount++;
+                        continue;
+                    }
+
+                    int index = i;
+                    string openingBracket = ImbricableBracketsPairing.Keys.FirstOrDefault(key => expression.Substring(index).StartsWith(key, StringComparisonForCasing));
+
+                    if (openingBracket != null)
+                    {
+                        i+= openingBracket.Length;
+                        string closingBrackets = ImbricableBracketsPairing[openingBracket];
+                        currentExpression += openingBracket + GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, false, null, openingBracket, closingBrackets).SingleOrDefault() + closingBrackets;
+                        continue;
+                    }
+
+                    s = expression.Substring(i, 1);
+
                     if (checkSeparator && s.Equals(separator) && bracketCount == 1)
                     {
                         expressionsList.Add(currentExpression);
@@ -3476,7 +3481,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
             if (bracketCount > 0)
             {
                 string beVerb = bracketCount == 1 ? "is" : "are";
-                throw new Exception($"{bracketCount} '{endChar}' character {beVerb} missing in expression : [{expression}]");
+                throw new Exception($"{bracketCount} '{endToken}' character {beVerb} missing in expression : [{expression}]");
             }
 
             return expressionsList;

From cee2cd8eff2f32a7952dfd69ba82c7b5d405c354 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 12 Jan 2021 07:47:47 +0100
Subject: [PATCH 05/48] Some correction in parsing brackets

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs      | 14 ++++++++++++++
 .../Resources.Designer.cs                          | 14 +++++++++++++-
 CodingSeb.ExpressionEvaluator.Tests/Resources.resx |  3 +++
 .../Resources/Script0073.txt                       |  4 ++++
 .../ExpressionEvaluator.cs                         |  3 ++-
 5 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0073.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index f27598e..3c112ac 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1611,6 +1611,15 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
                     .SetCategory("Exception");
 
                 #endregion
+
+                #region bad return
+
+                yield return new TestCaseData(new ExpressionEvaluator(), Resources.Script0073, typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("return")
+                    .SetCategory("Exception");
+
+                #endregion
             }
         }
 
@@ -1619,12 +1628,15 @@ public void ExceptionThrowingScriptEvaluation(ExpressionEvaluator evaluator, str
         {
             evaluator.Namespaces.Add("CodingSeb.ExpressionEvaluator.Tests");
 
+            bool exceptionThrown = false;
+
             try
             {
                 evaluator.ScriptEvaluate(evaluator.RemoveComments(script));
             }
             catch(Exception exception)
             {
+                exceptionThrown = true;
                 exception.ShouldBeAssignableTo(exceptionType);
                 if (exceptionMessage != null)
                 {
@@ -1632,6 +1644,8 @@ public void ExceptionThrowingScriptEvaluation(ExpressionEvaluator evaluator, str
                 }
             }
 
+            exceptionThrown.ShouldBeTrue();
+
             ToTestAfter?.Invoke();
         }
 
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index db9b2fc..8841734 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1249,12 +1249,24 @@ public static string Script0071 {
         ///   Looks up a localized string similar to /* Script0072 */
         ///var myVar = 8;
         ///
-        ///return (myVar);.
+        ///return( myVar );.
         /// </summary>
         public static string Script0072 {
             get {
                 return ResourceManager.GetString("Script0072", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0073 */
+        ///var myVar = 8;
+        ///
+        ///returnmyVar;.
+        /// </summary>
+        public static string Script0073 {
+            get {
+                return ResourceManager.GetString("Script0073", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index 1f55641..66beb18 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -334,4 +334,7 @@
   <data name="Script0072" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0072.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0073" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0073.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0073.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0073.txt
new file mode 100644
index 0000000..ccde4ff
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0073.txt
@@ -0,0 +1,4 @@
+﻿/* Script0073 */
+var myVar = 8;
+
+returnmyVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 4cfa98f..c65bca8 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -10,7 +10,6 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
-using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.Dynamic;
 using System.Globalization;
@@ -3450,6 +3449,8 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                     if (expression.Substring(i).StartsWith(startToken, StringComparisonForCasing))
                     {
                         bracketCount++;
+                        i += startToken.Length - 1;
+                        currentExpression += startToken;
                         continue;
                     }
 

From 667a797b45935e0bd8a8ab1bd78f3103d576ae7c Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 13 Jan 2021 15:02:56 +0100
Subject: [PATCH 06/48] Options in progress

---
 .../ExpressionEvaluator.cs                    | 89 ++++++++++++-------
 1 file changed, 58 insertions(+), 31 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index c65bca8..e2e70b7 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -479,7 +479,7 @@ protected static object IndexingOperatorFunc(dynamic left, dynamic right)
 
         /// <summary>
         /// Specify for each possible imbricable type of opening brackets the corresponding closing bracket
-        /// By default : { "(" : ")", "{" : "}", "[", "]" }
+        /// Default value : { "(" : ")", "{" : "}", "[", "]" }
         /// </summary>
         public IDictionary<string, string> ImbricableBracketsPairing { get; } = new Dictionary<string, string>()
         {
@@ -580,7 +580,7 @@ public virtual IList<Assembly> Assemblies
         /// <summary>
         /// If <c>true</c> all evaluation are case sensitives.
         /// If <c>false</c> evaluations are case insensitive.
-        /// By default = true
+        /// Default value = true
         /// </summary>
         public bool OptionCaseSensitiveEvaluationActive
         {
@@ -611,7 +611,7 @@ protected StringComparer StringComparerForCasing
         /// <summary>
         /// If <c>true</c> all numbers without decimal and suffixes evaluations will be done as double
         /// If <c>false</c> Integers values without decimal and suffixes will be evaluate as int as in C# (Warning some operation can round values)
-        /// By default = false
+        /// Default value = false
         /// </summary>
         public bool OptionForceIntegerNumbersEvaluationsAsDoubleByDefault { get; set; }
 
@@ -643,7 +643,7 @@ public CultureInfo CultureInfoForNumberParsing
 
         /// <summary>
         /// Allow to change the decimal separator of numbers when parsing expressions.
-        /// By default "."
+        /// Default value "."
         /// Warning if using comma change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts.
         /// Modify CultureInfoForNumberParsing.
         /// </summary>
@@ -669,7 +669,7 @@ public string OptionNumberParsingDecimalSeparator
 
         /// <summary>
         /// Allow to change the thousand separator of numbers when parsing expressions.
-        /// By default string.Empty
+        /// Default value string.Empty
         /// Warning if using comma change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts.
         /// Modify CultureInfoForNumberParsing.
         /// </summary>
@@ -693,14 +693,14 @@ public string OptionNumberParsingThousandSeparator
 
         /// <summary>
         /// Allow to change the separator of functions arguments.
-        /// By default ","
+        /// Default value ","
         /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
         /// </summary>
         public string OptionFunctionArgumentsSeparator { get; set; } = ",";
 
         /// <summary>
         /// Allow to change the separator of Object and collections Initialization between { and } after the keyword new.
-        /// By default ","
+        /// Default value ","
         /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
         /// </summary>
         public string OptionInitializersSeparator { get; set; } = ",";
@@ -708,14 +708,14 @@ public string OptionNumberParsingThousandSeparator
         /// <summary>
         /// if <c>true</c> allow to add the prefix Fluid or Fluent before void methods names to return back the instance on which the method is call.
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionFluidPrefixingActive { get; set; } = true;
 
         /// <summary>
         /// if <c>true</c> allow the use of inline namespace (Can be slow, and is less secure).
         /// if <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available).
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionInlineNamespacesEvaluationActive { get; set; } = true;
 
@@ -724,7 +724,7 @@ public string OptionNumberParsingThousandSeparator
         /// <summary>
         /// if <c>true</c> allow to create instance of object with the Default function new(ClassNam,...).
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionNewFunctionEvaluationActive
         {
@@ -749,62 +749,62 @@ public bool OptionNewFunctionEvaluationActive
         /// <summary>
         /// if <c>true</c> allow to create instance of object with the C# syntax new ClassName(...).
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionNewKeywordEvaluationActive { get; set; } = true;
 
         /// <summary>
         /// if <c>true</c> allow to call static methods on classes.
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionStaticMethodsCallActive { get; set; } = true;
 
         /// <summary>
         /// if <c>true</c> allow to get static properties on classes
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionStaticPropertiesGetActive { get; set; } = true;
 
         /// <summary>
         /// if <c>true</c> allow to call instance methods on objects.
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionInstanceMethodsCallActive { get; set; } = true;
 
         /// <summary>
         /// if <c>true</c> allow to get instance properties on objects
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionInstancePropertiesGetActive { get; set; } = true;
 
         /// <summary>
         /// if <c>true</c> allow to get object at index or key like IndexedObject[indexOrKey]
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionIndexingActive { get; set; } = true;
 
         /// <summary>
         /// if <c>true</c> allow string interpretation with ""
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionStringEvaluationActive { get; set; } = true;
 
         /// <summary>
         /// if <c>true</c> allow char interpretation with ''
         /// if <c>false</c> unactive this functionality.
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionCharEvaluationActive { get; set; } = true;
 
         /// <summary>
         /// If <c>true</c> Evaluate function is callables in an expression. If <c>false</c> Evaluate is not callable.
-        /// By default : true
+        /// Default value : true
         /// if set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
         /// </summary>
         public bool OptionEvaluateFunctionActive { get; set; } = true;
@@ -812,27 +812,27 @@ public bool OptionNewFunctionEvaluationActive
         /// <summary>
         /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ++ or --)
         /// If <c>false</c> unactive this functionality
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionVariableAssignationActive { get; set; } = true;
 
         /// <summary>
         /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ++ or --)
         /// If <c>false</c> unactive this functionality
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionPropertyOrFieldSetActive { get; set; } = true;
 
         /// <summary>
         /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ++ or --)
         /// If <c>false</c> unactive this functionality
-        /// By default : true
+        /// Default value : true
         /// </summary>
         public bool OptionIndexingAssignationActive { get; set; } = true;
 
         /// <summary>
         /// If <c>true</c> ScriptEvaluate function is callables in an expression. If <c>false</c> Evaluate is not callable.
-        /// By default : true
+        /// Default value : true
         /// if set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
         /// </summary>
         public bool OptionScriptEvaluateFunctionActive { get; set; } = true;
@@ -841,7 +841,7 @@ public bool OptionNewFunctionEvaluationActive
         /// If <c>ReturnAutomaticallyLastEvaluatedExpression</c> ScriptEvaluate return automatically the last evaluated expression if no return keyword is met.
         /// If <c>ReturnNull</c> return null if no return keyword is met.
         /// If <c>ThrowSyntaxException</c> a exception is throw if no return keyword is met.
-        /// By default : ReturnAutomaticallyLastEvaluatedExpression;
+        /// Default value : ReturnAutomaticallyLastEvaluatedExpression;
         /// </summary>
         public OptionOnNoReturnKeywordFoundInScriptAction OptionOnNoReturnKeywordFoundInScriptAction { get; set; }
 
@@ -855,7 +855,7 @@ public bool OptionNewFunctionEvaluationActive
         private string optionScriptBlocksKeywordsHeadStatementsStartBracket = "(";
         /// <summary>
         /// To specify the character or string that begin the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// By default : <c>"("</c>
+        /// Default value : <c>"("</c>
         /// </summary>
         public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
         {
@@ -869,28 +869,40 @@ public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
 
         /// <summary>
         /// To specify the character or string that end the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// By default : <c>")"</c>
+        /// Default value : <c>")"</c>
         /// </summary>
-        public string OptionScriptBlocksKeywordsHeadStatementsEndBracket { get; set; } = ")";
+        public string OptionScriptBlocksKeywordsHeadExpressionEndBracket { get; set; } = ")";
 
         /// <summary>
         /// To specify the character or string that separate the head statements and the block statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// By default : <c>":"</c>
+        /// Default value : <c>":"</c>
         /// </summary>
-        public string OptionScriptBlockKeywordsHeadStatementsAndBlockSeparator { get; set; } = ":";
+        public string OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator { get; set; } = ":";
+
+        /// <summary>
+        /// Specify how to detect the separation between head expression and the block of code is made in script block keyword (if, else if, for, foreach while, do.. while)
+        /// Default value : <c>HeadBrackets</c>
+        /// </summary>
+        public SyntaxForHeadExpressionInScriptBlocksKeywords OptionSyntaxForHeadExpressionInScriptBlocksKeywords { get; set; } = SyntaxForHeadExpressionInScriptBlocksKeywords.HeadBrackets;
 
         /// <summary>
         /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
-        /// By default : "{"
+        /// Default value : <c>"{"</c>
         /// </summary>
         public string OptionScriptBlockStartBrackets { get; set; } = "{";
 
         /// <summary>
         /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
-        /// By default : "}"
+        /// Default value : <c>"}"</c>
         /// </summary>
         public string OptionScriptBlockEndBrackets { get; set; } = "}";
 
+        /// <summary>
+        /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
+        /// Default value : OptionalBracketsForStartAndEndWhenSingleStatement
+        /// </summary>
+        public SyntaxForScriptBlocksIdentifier OptionSyntaxForScriptBlocksIdentifier { get; set; } = SyntaxForScriptBlocksIdentifier.OptionalBracketsForStartAndEndWhenSingleStatement;
+
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)
         /// If <c>false</c> Allow to access only to public members.
@@ -3923,6 +3935,21 @@ public enum OptionOnNoReturnKeywordFoundInScriptAction
         ThrowSyntaxException
     }
 
+    public enum SyntaxForHeadExpressionInScriptBlocksKeywords
+    {
+        HeadBrackets,
+        SeparatorBetweenHeadAndBlock,
+        Both,
+        Any
+    }
+
+    public enum SyntaxForScriptBlocksIdentifier
+    {
+        OptionalBracketsForStartAndEndWhenSingleStatement,
+        MandatoryBracketsForStartAndEnd,
+        Indentation
+    }
+
     #endregion
 
     #region ExpressionEvaluator linked public classes (specific Exceptions, EventArgs and Operators)

From c85092acbf84c6c79e8b4f691a7d73e392415439 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Thu, 14 Jan 2021 09:54:51 +0100
Subject: [PATCH 07/48] Renaming

---
 CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index e2e70b7..0ec7259 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -68,7 +68,7 @@ public partial class ExpressionEvaluator
         // For script only
         protected Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)[(]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
-        protected static readonly Regex blockKeywordsWithoutParenthesesBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+        protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
         protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s+)|(?=\())", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
         protected static readonly Regex nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)[;]", RegexOptions.Compiled);
@@ -883,7 +883,7 @@ public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
         /// Specify how to detect the separation between head expression and the block of code is made in script block keyword (if, else if, for, foreach while, do.. while)
         /// Default value : <c>HeadBrackets</c>
         /// </summary>
-        public SyntaxForHeadExpressionInScriptBlocksKeywords OptionSyntaxForHeadExpressionInScriptBlocksKeywords { get; set; } = SyntaxForHeadExpressionInScriptBlocksKeywords.HeadBrackets;
+        public SyntaxForHeadExpressionInScriptBlocksKeywords OptionSyntaxForHeadExpressionInScriptBlocksKeywords { get; set; }
 
         /// <summary>
         /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
@@ -901,7 +901,7 @@ public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
         /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
         /// Default value : OptionalBracketsForStartAndEndWhenSingleStatement
         /// </summary>
-        public SyntaxForScriptBlocksIdentifier OptionSyntaxForScriptBlocksIdentifier { get; set; } = SyntaxForScriptBlocksIdentifier.OptionalBracketsForStartAndEndWhenSingleStatement;
+        public SyntaxForScriptBlocksIdentifier OptionSyntaxForScriptBlocksIdentifier { get; set; }
 
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)
@@ -1130,7 +1130,7 @@ void ExecuteBlocksStacks()
                 Match blockKeywordsBeginingMatch;
                 if (script.Substring(startOfExpression, i - startOfExpression).Trim().Equals(string.Empty)
                     && ((blockKeywordsBeginingMatch = blockKeywordsBeginningRegex.Match(script.Substring(i))).Success
-                        || (blockKeywordsWithoutParenthesesBeginningMatch = blockKeywordsWithoutParenthesesBeginningRegex.Match(script.Substring(i))).Success))
+                        || (blockKeywordsWithoutParenthesesBeginningMatch = blockKeywordsWithoutHeadStatementBeginningRegex.Match(script.Substring(i))).Success))
                 {
                     i += blockKeywordsBeginingMatch.Success ? blockKeywordsBeginingMatch.Length : blockKeywordsWithoutParenthesesBeginningMatch.Length;
                     string keyword = blockKeywordsBeginingMatch.Success ? blockKeywordsBeginingMatch.Groups["keyword"].Value.Replace(" ", "").Replace("\t", "") : (blockKeywordsWithoutParenthesesBeginningMatch?.Groups["keyword"].Value ?? string.Empty);

From 2ade4eb0261c76feab036e5daf9b12fbf7eb2273 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Thu, 14 Jan 2021 14:37:43 +0100
Subject: [PATCH 08/48] Flexible EndOfExpression part 1

---
 .../ExpressionEvaluator.cs                    | 60 +++++++++++++------
 1 file changed, 43 insertions(+), 17 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 0ec7259..8a9d38d 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -71,16 +71,24 @@ public partial class ExpressionEvaluator
         protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
         protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s+)|(?=\())", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
-        protected static readonly Regex nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)[;]", RegexOptions.Compiled);
+        protected Regex nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)[;]", RegexOptions.Compiled);
 
         /// <summary>
         /// Rebuild some Regex to detect blocks keywords in script
         /// </summary>
-        protected void RefreshBlocksKeywordDetection()
+        protected virtual void RefreshBlocksKeywordDetection()
         {
             blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket), RegexOptions.IgnoreCase | RegexOptions.Compiled);
         }
 
+        /// <summary>
+        /// Rebuild some Regex to detect end of expression
+        /// </summary>
+        protected virtual void RefreshEndOfExpressionDetection()
+        {
+            nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)" + Regex.Escape(OptionScriptEndOfExpression), RegexOptions.IgnoreCase | RegexOptions.Compiled);
+        }
+
         #endregion
 
         #region enums 
@@ -845,9 +853,24 @@ public bool OptionNewFunctionEvaluationActive
         /// </summary>
         public OptionOnNoReturnKeywordFoundInScriptAction OptionOnNoReturnKeywordFoundInScriptAction { get; set; }
 
+        private string optionScriptEndOfExpression = ";";
+        /// <summary>
+        /// The character or string that is used to separate expressions in script.
+        /// Default value : ";"
+        /// </summary>
+        public string OptionScriptEndOfExpression
+        {
+            get { return optionScriptEndOfExpression; }
+            set
+            {
+                optionScriptEndOfExpression = value;
+                RefreshEndOfExpressionDetection();
+            }
+        }
+
         /// <summary>
-        /// If <c>true</c> ScriptEvaluate need to have a semicolon [;] after each expression.
-        /// If <c>false</c> Allow to omit the semicolon for the last expression of the script.
+        /// If <c>true</c> ScriptEvaluate need to have a semicolon [;] or the specified text in OptionScriptEndOfExpression after each expression.
+        /// If <c>false</c> Allow to omit the OptionScriptEndOfExpression for the last expression of the script.
         /// Default : true
         /// </summary>
         public bool OptionScriptNeedSemicolonAtTheEndOfLastExpression { get; set; } = true;
@@ -1134,7 +1157,7 @@ void ExecuteBlocksStacks()
                 {
                     i += blockKeywordsBeginingMatch.Success ? blockKeywordsBeginingMatch.Length : blockKeywordsWithoutParenthesesBeginningMatch.Length;
                     string keyword = blockKeywordsBeginingMatch.Success ? blockKeywordsBeginingMatch.Groups["keyword"].Value.Replace(" ", "").Replace("\t", "") : (blockKeywordsWithoutParenthesesBeginningMatch?.Groups["keyword"].Value ?? string.Empty);
-                    List<string> keywordAttributes = blockKeywordsBeginingMatch.Success ? GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, ";") : null;
+                    List<string> keywordAttributes = blockKeywordsBeginingMatch.Success ? GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptEndOfExpression) : null;
 
                     if (blockKeywordsBeginingMatch.Success)
                         i++;
@@ -1159,14 +1182,15 @@ void ExecuteBlocksStacks()
                         while (i < script.Length && continueExpressionParsing)
                         {
                             if (TryParseStringAndParenthisAndCurlyBrackets(script, ref i)) { }
-                            else if (script.Length - i >= 3 && script.Substring(i, 3).Equals("';'"))
+                            else if (OptionScriptEndOfExpression.Length == 1 && script.Length - i >= 3 && script.Substring(i, 3).Equals($"'{OptionScriptEndOfExpression}'"))
                             {
                                 i += 2;
                             }
-                            else if (script[i] == ';')
+                            else if (script.Substring(i).StartsWith(OptionScriptEndOfExpression))
                             {
                                 subScript = script.Substring(startOfExpression, i + 1 - startOfExpression);
                                 continueExpressionParsing = false;
+                                i += OptionScriptEndOfExpression.Length - 1;
                             }
 
                             i++;
@@ -1246,7 +1270,7 @@ void ExecuteBlocksStacks()
                                 && blockKeywordsBeginingMatch.Groups["keyword"].Value.Equals("while", StringComparisonForCasing))
                             {
                                 i += blockKeywordsBeginingMatch.Length;
-                                keywordAttributes = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, ";");
+                                keywordAttributes = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptEndOfExpression);
 
                                 i++;
 
@@ -1274,7 +1298,7 @@ void ExecuteBlocksStacks()
                                 }
                                 else
                                 {
-                                    throw new ExpressionEvaluatorSyntaxErrorException("A [;] character is missing. (After the do while condition)");
+                                    throw new ExpressionEvaluatorSyntaxErrorException($"A [{OptionScriptEndOfExpression}] is missing. (After the do while condition)");
                                 }
                             }
                             else
@@ -1365,11 +1389,11 @@ void forAction(int index)
                     bool executed = false;
 
                     if (TryParseStringAndParenthisAndCurlyBrackets(script, ref i)) { }
-                    else if (script.Length - i > 2 && script.Substring(i, 3).Equals("';'"))
+                    else if (OptionScriptEndOfExpression.Length == 1 && script.Length - i >= 3 && script.Substring(i, 3).Equals($"'{OptionScriptEndOfExpression}'"))
                     {
                         i += 2;
                     }
-                    else if (script[i] == ';')
+                    else if (script.Substring(i).StartsWith(OptionScriptEndOfExpression))
                     {
                         lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
                         executed = true;
@@ -1391,7 +1415,7 @@ void forAction(int index)
             }
 
             if (!script.Substring(startOfExpression).Trim().Equals(string.Empty) && !isReturn && !isBreak && !isContinue && OptionScriptNeedSemicolonAtTheEndOfLastExpression)
-                throw new ExpressionEvaluatorSyntaxErrorException("A [;] character is missing.");
+                throw new ExpressionEvaluatorSyntaxErrorException($"A [{OptionScriptEndOfExpression}] character is missing.");
 
             ExecuteBlocksStacks();
 
@@ -3447,7 +3471,9 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                 }
                 else
                 {
-                    if (expression.Substring(i).StartsWith(endToken, StringComparisonForCasing))
+                    subExpr = expression.Substring(i);
+
+                    if (subExpr.StartsWith(endToken, StringComparisonForCasing))
                     {
                         bracketCount--;
                         if (bracketCount == 0)
@@ -3458,7 +3484,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                         }
                     }
 
-                    if (expression.Substring(i).StartsWith(startToken, StringComparisonForCasing))
+                    if (subExpr.StartsWith(startToken, StringComparisonForCasing))
                     {
                         bracketCount++;
                         i += startToken.Length - 1;
@@ -3477,16 +3503,16 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                         continue;
                     }
 
-                    s = expression.Substring(i, 1);
+                    subExpr = expression.Substring(i);
 
-                    if (checkSeparator && s.Equals(separator) && bracketCount == 1)
+                    if (checkSeparator && subExpr.StartsWith(separator) && bracketCount == 1)
                     {
                         expressionsList.Add(currentExpression);
                         currentExpression = string.Empty;
                     }
                     else
                     {
-                        currentExpression += s;
+                        currentExpression += expression.Substring(i,1);
                     }
                 }
             }

From 3101fb2ad8416afda082d197895dea46cca6f14f Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Thu, 14 Jan 2021 15:33:16 +0100
Subject: [PATCH 09/48] modif in progress

---
 CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 8a9d38d..274e879 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -853,12 +853,12 @@ public bool OptionNewFunctionEvaluationActive
         /// </summary>
         public OptionOnNoReturnKeywordFoundInScriptAction OptionOnNoReturnKeywordFoundInScriptAction { get; set; }
 
-        private string optionScriptEndOfExpression = ";";
+        private string[] optionScriptEndOfExpression = new[] { ";" };
         /// <summary>
-        /// The character or string that is used to separate expressions in script.
-        /// Default value : ";"
+        /// An array of string that are used to separate expressions in script.
+        /// Default value : {";"}
         /// </summary>
-        public string OptionScriptEndOfExpression
+        public string[] OptionScriptEndOfExpression
         {
             get { return optionScriptEndOfExpression; }
             set

From 2e493c5ac6149771c99963c15f2f36a1bf7445b6 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 15 Jan 2021 09:58:59 +0100
Subject: [PATCH 10/48] Add
 OptionScriptBlockKeywordsHeadSubExpressionsSeparator and
 OptionScriptEndOfExpression is now an array

---
 .../ExpressionEvaluator.cs                    | 41 ++++++++++++-------
 1 file changed, 26 insertions(+), 15 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 274e879..0f02d02 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -71,7 +71,7 @@ public partial class ExpressionEvaluator
         protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
         protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s+)|(?=\())", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
-        protected Regex nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)[;]", RegexOptions.Compiled);
+        protected Regex nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)(;)", RegexOptions.Compiled);
 
         /// <summary>
         /// Rebuild some Regex to detect blocks keywords in script
@@ -86,7 +86,7 @@ protected virtual void RefreshBlocksKeywordDetection()
         /// </summary>
         protected virtual void RefreshEndOfExpressionDetection()
         {
-            nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)" + Regex.Escape(OptionScriptEndOfExpression), RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            nextIsEndOfExpressionRegex = new Regex($@"^(?>\s*)({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         }
 
         #endregion
@@ -701,18 +701,25 @@ public string OptionNumberParsingThousandSeparator
 
         /// <summary>
         /// Allow to change the separator of functions arguments.
-        /// Default value ","
+        /// Default value : ","
         /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
         /// </summary>
         public string OptionFunctionArgumentsSeparator { get; set; } = ",";
 
         /// <summary>
         /// Allow to change the separator of Object and collections Initialization between { and } after the keyword new.
-        /// Default value ","
+        /// Default value : ","
         /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
         /// </summary>
         public string OptionInitializersSeparator { get; set; } = ",";
 
+        /// <summary>
+        /// The separator that separate each expression in block keyword's head
+        /// Default value : ";"
+        /// Example : for(int i = 0; i < 10; i++)
+        /// </summary>
+        public string OptionScriptBlockKeywordsHeadSubExpressionsSeparator { get; set; } = ";";
+
         /// <summary>
         /// if <c>true</c> allow to add the prefix Fluid or Fluent before void methods names to return back the instance on which the method is call.
         /// if <c>false</c> unactive this functionality.
@@ -818,21 +825,21 @@ public bool OptionNewFunctionEvaluationActive
         public bool OptionEvaluateFunctionActive { get; set; } = true;
 
         /// <summary>
-        /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ++ or --)
+        /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ??=, ++ or --)
         /// If <c>false</c> unactive this functionality
         /// Default value : true
         /// </summary>
         public bool OptionVariableAssignationActive { get; set; } = true;
 
         /// <summary>
-        /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ++ or --)
+        /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ??=, ++ or --)
         /// If <c>false</c> unactive this functionality
         /// Default value : true
         /// </summary>
         public bool OptionPropertyOrFieldSetActive { get; set; } = true;
 
         /// <summary>
-        /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ++ or --)
+        /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ??=, ++ or --)
         /// If <c>false</c> unactive this functionality
         /// Default value : true
         /// </summary>
@@ -1157,7 +1164,7 @@ void ExecuteBlocksStacks()
                 {
                     i += blockKeywordsBeginingMatch.Success ? blockKeywordsBeginingMatch.Length : blockKeywordsWithoutParenthesesBeginningMatch.Length;
                     string keyword = blockKeywordsBeginingMatch.Success ? blockKeywordsBeginingMatch.Groups["keyword"].Value.Replace(" ", "").Replace("\t", "") : (blockKeywordsWithoutParenthesesBeginningMatch?.Groups["keyword"].Value ?? string.Empty);
-                    List<string> keywordAttributes = blockKeywordsBeginingMatch.Success ? GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptEndOfExpression) : null;
+                    List<string> keywordAttributes = blockKeywordsBeginingMatch.Success ? GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator) : null;
 
                     if (blockKeywordsBeginingMatch.Success)
                         i++;
@@ -1182,11 +1189,11 @@ void ExecuteBlocksStacks()
                         while (i < script.Length && continueExpressionParsing)
                         {
                             if (TryParseStringAndParenthisAndCurlyBrackets(script, ref i)) { }
-                            else if (OptionScriptEndOfExpression.Length == 1 && script.Length - i >= 3 && script.Substring(i, 3).Equals($"'{OptionScriptEndOfExpression}'"))
+                            else if (script.Length - i >= 3 && OptionScriptEndOfExpression.Any( o =>  o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
                             {
                                 i += 2;
                             }
-                            else if (script.Substring(i).StartsWith(OptionScriptEndOfExpression))
+                            else if (nextIsEndOfExpressionRegex.IsMatch(script.Substring(i)))
                             {
                                 subScript = script.Substring(startOfExpression, i + 1 - startOfExpression);
                                 continueExpressionParsing = false;
@@ -1270,7 +1277,7 @@ void ExecuteBlocksStacks()
                                 && blockKeywordsBeginingMatch.Groups["keyword"].Value.Equals("while", StringComparisonForCasing))
                             {
                                 i += blockKeywordsBeginingMatch.Length;
-                                keywordAttributes = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptEndOfExpression);
+                                keywordAttributes = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator);
 
                                 i++;
 
@@ -1388,14 +1395,18 @@ void forAction(int index)
 
                     bool executed = false;
 
+                    Match nextIsEndOfExpressionMatch;
+
                     if (TryParseStringAndParenthisAndCurlyBrackets(script, ref i)) { }
-                    else if (OptionScriptEndOfExpression.Length == 1 && script.Length - i >= 3 && script.Substring(i, 3).Equals($"'{OptionScriptEndOfExpression}'"))
+                    else if (script.Length - i >= 3 && OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
                     {
                         i += 2;
                     }
-                    else if (script.Substring(i).StartsWith(OptionScriptEndOfExpression))
+                    else if ((nextIsEndOfExpressionMatch = nextIsEndOfExpressionRegex.Match(script.Substring(i))).Success)
                     {
                         lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
+                        i += nextIsEndOfExpressionMatch.Length - 1;
+                        startOfExpression += nextIsEndOfExpressionMatch.Length - 1;
                         executed = true;
                     }
 
@@ -1415,7 +1426,7 @@ void forAction(int index)
             }
 
             if (!script.Substring(startOfExpression).Trim().Equals(string.Empty) && !isReturn && !isBreak && !isContinue && OptionScriptNeedSemicolonAtTheEndOfLastExpression)
-                throw new ExpressionEvaluatorSyntaxErrorException($"A [{OptionScriptEndOfExpression}] character is missing.");
+                throw new ExpressionEvaluatorSyntaxErrorException($"An end of expression [{string.Join(",", OptionScriptEndOfExpression.Select(s=> "\"" + Regex.Escape(s) + "\""))}] token is missing.");
 
             ExecuteBlocksStacks();
 
@@ -3505,7 +3516,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
 
                     subExpr = expression.Substring(i);
 
-                    if (checkSeparator && subExpr.StartsWith(separator) && bracketCount == 1)
+                    if (separator != null && checkSeparator && bracketCount == 1 && subExpr.StartsWith(separator))
                     {
                         expressionsList.Add(currentExpression);
                         currentExpression = string.Empty;

From 61f1cb4b5e3e3ccb0098862df49f31fcf3209807 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 15 Jan 2021 10:52:22 +0100
Subject: [PATCH 11/48] First test For endof line chars as end of expression

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs   | 15 +++++++++++++++
 .../Resources.Designer.cs                       | 11 +++++++++++
 .../Resources.resx                              |  3 +++
 .../Resources/Script0074.txt                    |  4 ++++
 .../ExpressionEvaluator.cs                      | 17 ++++++++++++++---
 5 files changed, 47 insertions(+), 3 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0074.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 3c112ac..c69b685 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1419,6 +1419,21 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 #endregion
 
+                #region Flexible script syntax
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator01 = new ExpressionEvaluator()
+                {
+                    OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
+                    OptionScriptNeedSemicolonAtTheEndOfLastExpression = false
+                };
+
+                yield return new TestCaseData(Resources.Script0074, flexibleScriptSyntaxEvaluator01, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .Returns(8);
+
+                #endregion
+
                 #region For Bug correction (no regression)
 
                 yield return new TestCaseData(Resources.Script0049, null, null, null, null)
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index 8841734..dcaffae 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1268,5 +1268,16 @@ public static string Script0073 {
                 return ResourceManager.GetString("Script0073", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0074 */
+        ///var myVar = 8
+        ///return myVar.
+        /// </summary>
+        public static string Script0074 {
+            get {
+                return ResourceManager.GetString("Script0074", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index 66beb18..7e9ed12 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -337,4 +337,7 @@
   <data name="Script0073" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0073.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0074" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0074.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0074.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0074.txt
new file mode 100644
index 0000000..9cdea9a
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0074.txt
@@ -0,0 +1,4 @@
+﻿/* Script0074 */
+var myVar = 8
+
+return myVar
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 0f02d02..162b561 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -71,7 +71,7 @@ public partial class ExpressionEvaluator
         protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
         protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s+)|(?=\())", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
-        protected Regex nextIsEndOfExpressionRegex = new Regex(@"^(?>\s*)(;)", RegexOptions.Compiled);
+        protected Regex nextIsEndOfExpressionRegex = new Regex("^(;)", RegexOptions.Compiled);
 
         /// <summary>
         /// Rebuild some Regex to detect blocks keywords in script
@@ -86,7 +86,7 @@ protected virtual void RefreshBlocksKeywordDetection()
         /// </summary>
         protected virtual void RefreshEndOfExpressionDetection()
         {
-            nextIsEndOfExpressionRegex = new Regex($@"^(?>\s*)({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         }
 
         #endregion
@@ -875,6 +875,13 @@ public string[] OptionScriptEndOfExpression
             }
         }
 
+        /// <summary>
+        /// Specify to skip the evaluation of an empty expression in scripts otherwise it will throw an exception.
+        /// Default value : true;
+        /// For example when two semicolon ;; are present or when there are empty line with OptionScriptEndOfExpression set to end of line characters { "\r\n", "\r", "\n" }
+        /// </summary>
+        public bool OptionScriptSkipEmptyExpressions { get; set; } = true;
+
         /// <summary>
         /// If <c>true</c> ScriptEvaluate need to have a semicolon [;] or the specified text in OptionScriptEndOfExpression after each expression.
         /// If <c>false</c> Allow to omit the OptionScriptEndOfExpression for the last expression of the script.
@@ -1404,6 +1411,7 @@ void forAction(int index)
                     }
                     else if ((nextIsEndOfExpressionMatch = nextIsEndOfExpressionRegex.Match(script.Substring(i))).Success)
                     {
+
                         lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
                         i += nextIsEndOfExpressionMatch.Length - 1;
                         startOfExpression += nextIsEndOfExpressionMatch.Length - 1;
@@ -1524,7 +1532,10 @@ protected virtual object ScriptExpressionEvaluate(string script, ref int startOf
 
             startOfExpression = index + 1;
 
-            return ManageJumpStatementsOrExpressionEval(expression, ref isBreak, ref isContinue, ref isReturn, lastResult);
+            if (OptionScriptSkipEmptyExpressions && string.IsNullOrWhiteSpace(expression))
+                return lastResult;
+            else
+                return ManageJumpStatementsOrExpressionEval(expression, ref isBreak, ref isContinue, ref isReturn, lastResult);
         }
 
         protected virtual object ManageJumpStatementsOrExpressionEval(string expression, ref bool isBreak, ref bool isContinue, ref bool isReturn, object lastResult)

From 12f8490ecc28bc84d3d4ad133eb5dda7292eb8ec Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 15 Jan 2021 11:44:51 +0100
Subject: [PATCH 12/48] Block keyword flexible syntax in progress

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs      | 10 ++++++++++
 .../Resources.Designer.cs                          | 13 +++++++++++++
 CodingSeb.ExpressionEvaluator.Tests/Resources.resx |  3 +++
 .../Resources/Script0075.txt                       |  7 +++++++
 .../ExpressionEvaluator.cs                         | 14 +++++++++++---
 5 files changed, 44 insertions(+), 3 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0075.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index c69b685..9a48a3c 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1432,6 +1432,16 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("FlexibleScriptSyntax")
                     .Returns(8);
 
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
+                {
+                    OptionSyntaxForHeadExpressionInScriptBlocksKeywords = SyntaxForHeadExpressionInScriptBlocksKeywords.SeparatorBetweenHeadAndBlock
+                };
+
+                yield return new TestCaseData(Resources.Script0075, flexibleScriptSyntaxEvaluator02, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .Returns(8);
+
                 #endregion
 
                 #region For Bug correction (no regression)
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index dcaffae..f9e5301 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1272,6 +1272,7 @@ public static string Script0073 {
         /// <summary>
         ///   Looks up a localized string similar to /* Script0074 */
         ///var myVar = 8
+        ///
         ///return myVar.
         /// </summary>
         public static string Script0074 {
@@ -1279,5 +1280,17 @@ public static string Script0074 {
                 return ResourceManager.GetString("Script0074", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0074 */
+        ///var myVar = 8
+        ///
+        ///return myVar.
+        /// </summary>
+        public static string Script0075 {
+            get {
+                return ResourceManager.GetString("Script0075", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index 7e9ed12..7aacc88 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -340,4 +340,7 @@
   <data name="Script0074" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0074.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0075" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0075.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0075.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0075.txt
new file mode 100644
index 0000000..39496b6
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0075.txt
@@ -0,0 +1,7 @@
+﻿/* Script0075 */
+var myVar = 8;
+
+if myVar > 7: 
+	myVar = 20;
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 162b561..82b9378 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -66,7 +66,7 @@ public partial class ExpressionEvaluator
         protected static readonly Regex newLineCharsRegex = new Regex(@"\r\n|\r|\n", RegexOptions.Compiled);
 
         // For script only
-        protected Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)[(]", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+        protected Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)(?<startBracket>\()", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
@@ -78,7 +78,16 @@ public partial class ExpressionEvaluator
         /// </summary>
         protected virtual void RefreshBlocksKeywordDetection()
         {
-            blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket), RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            string optional = string.Empty;
+            string startBracketDetection = string.Empty;
+
+            if (OptionSyntaxForHeadExpressionInScriptBlocksKeywords == SyntaxForHeadExpressionInScriptBlocksKeywords.Any)
+                optional = "?";
+
+            if(OptionSyntaxForHeadExpressionInScriptBlocksKeywords != SyntaxForHeadExpressionInScriptBlocksKeywords.SeparatorBetweenHeadAndBlock)
+                startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
+
+            blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, RegexOptions.IgnoreCase | RegexOptions.Compiled);
         }
 
         /// <summary>
@@ -1411,7 +1420,6 @@ void forAction(int index)
                     }
                     else if ((nextIsEndOfExpressionMatch = nextIsEndOfExpressionRegex.Match(script.Substring(i))).Success)
                     {
-
                         lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
                         i += nextIsEndOfExpressionMatch.Length - 1;
                         startOfExpression += nextIsEndOfExpressionMatch.Length - 1;

From 183037d3f7b9d78209370948a5d57791b1287127 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 15 Jan 2021 13:24:11 +0100
Subject: [PATCH 13/48] OptionScriptNeedSemicolonAtTheEndOfLastExpression =>
 OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs            | 9 +++++----
 CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs     | 8 ++++----
 TryWindow/MainWindow.xaml.cs                             | 2 +-
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 9a48a3c..5997846 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1165,7 +1165,7 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator evaluatorForNoSemicolonAtTheEnd = new ExpressionEvaluator()
                 {
-                    OptionScriptNeedSemicolonAtTheEndOfLastExpression = false
+                    OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false
                 };
 
                 yield return new TestCaseData(Resources.Script0061, evaluatorForNoSemicolonAtTheEnd, null, null, null)
@@ -1424,12 +1424,13 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator01 = new ExpressionEvaluator()
                 {
                     OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
-                    OptionScriptNeedSemicolonAtTheEndOfLastExpression = false
+                    OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false
                 };
 
                 yield return new TestCaseData(Resources.Script0074, flexibleScriptSyntaxEvaluator01, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptEndOfExpression")
                     .Returns(8);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
@@ -1513,7 +1514,7 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("Better Than C#")
                     .Returns("Result Hey 9, 5");
 
-                yield return new TestCaseData(Resources.Script0066, new ExpressionEvaluator { OptionScriptNeedSemicolonAtTheEndOfLastExpression = false }, null, null, null)
+                yield return new TestCaseData(Resources.Script0066, new ExpressionEvaluator { OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false }, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("primaryTyped variable")
                     .SetCategory("string")
@@ -1524,7 +1525,7 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("OptionScriptNeedSemicolonAtTheEndOfLastExpression")
                     .Returns("0,1,2,3,4,");
 
-                yield return new TestCaseData(Resources.Script0070, new ExpressionEvaluator { OptionScriptNeedSemicolonAtTheEndOfLastExpression = false }, null, null, null)
+                yield return new TestCaseData(Resources.Script0070, new ExpressionEvaluator { OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false }, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("new Exception must not throw the exception")
                     .Returns(3);
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 82b9378..6de4d01 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -896,7 +896,7 @@ public string[] OptionScriptEndOfExpression
         /// If <c>false</c> Allow to omit the OptionScriptEndOfExpression for the last expression of the script.
         /// Default : true
         /// </summary>
-        public bool OptionScriptNeedSemicolonAtTheEndOfLastExpression { get; set; } = true;
+        public bool OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression { get; set; } = true;
 
         private string optionScriptBlocksKeywordsHeadStatementsStartBracket = "(";
         /// <summary>
@@ -1426,7 +1426,7 @@ void forAction(int index)
                         executed = true;
                     }
 
-                    if (!OptionScriptNeedSemicolonAtTheEndOfLastExpression && i == script.Length - 1 && !executed)
+                    if (!OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression && i == script.Length - 1 && !executed)
                     {
                         i++;
                         lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
@@ -1436,12 +1436,12 @@ void forAction(int index)
                     ifBlockEvaluatedState = IfBlockEvaluatedState.NoBlockEvaluated;
                     tryBlockEvaluatedState = TryBlockEvaluatedState.NoBlockEvaluated;
 
-                    if (OptionScriptNeedSemicolonAtTheEndOfLastExpression || i < script.Length)
+                    if (OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression || i < script.Length)
                         i++;
                 }
             }
 
-            if (!script.Substring(startOfExpression).Trim().Equals(string.Empty) && !isReturn && !isBreak && !isContinue && OptionScriptNeedSemicolonAtTheEndOfLastExpression)
+            if (!script.Substring(startOfExpression).Trim().Equals(string.Empty) && !isReturn && !isBreak && !isContinue && OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression)
                 throw new ExpressionEvaluatorSyntaxErrorException($"An end of expression [{string.Join(",", OptionScriptEndOfExpression.Select(s=> "\"" + Regex.Escape(s) + "\""))}] token is missing.");
 
             ExecuteBlocksStacks();
diff --git a/TryWindow/MainWindow.xaml.cs b/TryWindow/MainWindow.xaml.cs
index 8edbfe3..ab2522a 100644
--- a/TryWindow/MainWindow.xaml.cs
+++ b/TryWindow/MainWindow.xaml.cs
@@ -38,7 +38,7 @@ private async void CalculateButton_Click(object sender, RoutedEventArgs e)
 
             ExpressionEvaluator evaluator = new ExpressionEvaluator()
             {
-                OptionScriptNeedSemicolonAtTheEndOfLastExpression = NeedSemicolonAtTheEndCheckBox.IsChecked.GetValueOrDefault(),
+                OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = NeedSemicolonAtTheEndCheckBox.IsChecked.GetValueOrDefault(),
             };
 
             if (UseCachesCheckbox.IsChecked ?? false)

From 1a514e597c2a3ae51dc77cb29782c6332d09845d Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 15 Jan 2021 15:27:33 +0100
Subject: [PATCH 14/48] OptionScriptSyntaxForHeadStatementInBlocksKeywords =
 SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock OK +
 tests

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs |  9 +++-
 .../Resources.Designer.cs                     | 26 +++++++--
 .../Resources.resx                            |  3 ++
 .../Resources/Script0076.txt                  |  9 ++++
 .../ExpressionEvaluator.cs                    | 54 +++++++++++++------
 5 files changed, 79 insertions(+), 22 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0076.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 5997846..710f1ab 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1435,13 +1435,18 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
                 {
-                    OptionSyntaxForHeadExpressionInScriptBlocksKeywords = SyntaxForHeadExpressionInScriptBlocksKeywords.SeparatorBetweenHeadAndBlock
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
                 };
 
                 yield return new TestCaseData(Resources.Script0075, flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .Returns(8);
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0076, flexibleScriptSyntaxEvaluator02, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .Returns(20);
 
                 #endregion
 
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index f9e5301..8949992 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1282,15 +1282,35 @@ public static string Script0074 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0074 */
-        ///var myVar = 8
+        ///   Looks up a localized string similar to /* Script0075 */
+        ///var myVar = 8;
         ///
-        ///return myVar.
+        ///if myVar &gt; 7: 
+        ///	myVar = 20;
+        ///
+        ///return myVar;.
         /// </summary>
         public static string Script0075 {
             get {
                 return ResourceManager.GetString("Script0075", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0076 */
+        ///var myVar = 8;
+        ///
+        ///if myVar &gt; 7:
+        ///{
+        ///	myVar = 20;
+        ///}
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0076 {
+            get {
+                return ResourceManager.GetString("Script0076", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index 7aacc88..79072ff 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -343,4 +343,7 @@
   <data name="Script0075" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0075.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0076" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0076.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0076.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0076.txt
new file mode 100644
index 0000000..1b4e88c
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0076.txt
@@ -0,0 +1,9 @@
+﻿/* Script0076 */
+var myVar = 8;
+
+if myVar > 7:
+{
+	myVar = 20;
+}
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 6de4d01..863dda5 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -81,10 +81,10 @@ protected virtual void RefreshBlocksKeywordDetection()
             string optional = string.Empty;
             string startBracketDetection = string.Empty;
 
-            if (OptionSyntaxForHeadExpressionInScriptBlocksKeywords == SyntaxForHeadExpressionInScriptBlocksKeywords.Any)
+            if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any)
                 optional = "?";
 
-            if(OptionSyntaxForHeadExpressionInScriptBlocksKeywords != SyntaxForHeadExpressionInScriptBlocksKeywords.SeparatorBetweenHeadAndBlock)
+            if(OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
                 startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
 
             blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, RegexOptions.IgnoreCase | RegexOptions.Compiled);
@@ -925,11 +925,20 @@ public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
         /// </summary>
         public string OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator { get; set; } = ":";
 
+        private SyntaxForHeadStatementInBlocksKeywords optionScriptSyntaxForHeadStatementInBlocksKeywords;
         /// <summary>
         /// Specify how to detect the separation between head expression and the block of code is made in script block keyword (if, else if, for, foreach while, do.. while)
         /// Default value : <c>HeadBrackets</c>
         /// </summary>
-        public SyntaxForHeadExpressionInScriptBlocksKeywords OptionSyntaxForHeadExpressionInScriptBlocksKeywords { get; set; }
+        public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatementInBlocksKeywords
+        {
+            get { return optionScriptSyntaxForHeadStatementInBlocksKeywords; }
+            set
+            {
+                optionScriptSyntaxForHeadStatementInBlocksKeywords = value;
+                RefreshBlocksKeywordDetection();
+            }
+        }
 
         /// <summary>
         /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
@@ -1172,18 +1181,29 @@ void ExecuteBlocksStacks()
             while (!isReturn && !isBreak && !isContinue && i < script.Length)
             {
                 Match blockKeywordsWithoutParenthesesBeginningMatch = null;
+                Match blockKeywordsBeginingMatch = null;
 
-                Match blockKeywordsBeginingMatch;
                 if (script.Substring(startOfExpression, i - startOfExpression).Trim().Equals(string.Empty)
                     && ((blockKeywordsBeginingMatch = blockKeywordsBeginningRegex.Match(script.Substring(i))).Success
                         || (blockKeywordsWithoutParenthesesBeginningMatch = blockKeywordsWithoutHeadStatementBeginningRegex.Match(script.Substring(i))).Success))
                 {
                     i += blockKeywordsBeginingMatch.Success ? blockKeywordsBeginingMatch.Length : blockKeywordsWithoutParenthesesBeginningMatch.Length;
                     string keyword = blockKeywordsBeginingMatch.Success ? blockKeywordsBeginingMatch.Groups["keyword"].Value.Replace(" ", "").Replace("\t", "") : (blockKeywordsWithoutParenthesesBeginningMatch?.Groups["keyword"].Value ?? string.Empty);
-                    List<string> keywordAttributes = blockKeywordsBeginingMatch.Success ? GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator) : null;
+                    List<string> keywordParameters = null;
 
                     if (blockKeywordsBeginingMatch.Success)
+                    {
+                        if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
+                        {
+                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator, null, OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator);
+                        }
+                        else
+                        {
+                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator, OptionScriptBlocksKeywordsHeadStatementsStartBracket, OptionScriptBlocksKeywordsHeadExpressionEndBracket);
+                        }
+
                         i++;
+                    }
 
                     Match blockBeginningMatch = blockBeginningRegex.Match(script.Substring(i));
 
@@ -1231,7 +1251,7 @@ void ExecuteBlocksStacks()
                         }
                         else
                         {
-                            ifElseStatementsList.Add(new List<string>() { keywordAttributes[0], subScript });
+                            ifElseStatementsList.Add(new List<string>() { keywordParameters[0], subScript });
                             ifBlockEvaluatedState = IfBlockEvaluatedState.ElseIf;
                         }
                     }
@@ -1255,7 +1275,7 @@ void ExecuteBlocksStacks()
                         }
                         else
                         {
-                            tryStatementsList.Add(new List<string>() { "catch", keywordAttributes.Count > 0 ? keywordAttributes[0] : null, subScript });
+                            tryStatementsList.Add(new List<string>() { "catch", keywordParameters.Count > 0 ? keywordParameters[0] : null, subScript });
                             tryBlockEvaluatedState = TryBlockEvaluatedState.Catch;
                         }
                     }
@@ -1277,7 +1297,7 @@ void ExecuteBlocksStacks()
 
                         if (keyword.Equals("if", StringComparisonForCasing))
                         {
-                            ifElseStatementsList.Add(new List<string>() { keywordAttributes[0], subScript });
+                            ifElseStatementsList.Add(new List<string>() { keywordParameters[0], subScript });
                             ifBlockEvaluatedState = IfBlockEvaluatedState.If;
                             tryBlockEvaluatedState = TryBlockEvaluatedState.NoBlockEvaluated;
                         }
@@ -1293,7 +1313,7 @@ void ExecuteBlocksStacks()
                                 && blockKeywordsBeginingMatch.Groups["keyword"].Value.Equals("while", StringComparisonForCasing))
                             {
                                 i += blockKeywordsBeginingMatch.Length;
-                                keywordAttributes = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator);
+                                keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator);
 
                                 i++;
 
@@ -1317,7 +1337,7 @@ void ExecuteBlocksStacks()
                                             isContinue = false;
                                         }
                                     }
-                                    while (!isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[0], ref isBreak, ref isContinue, ref isReturn, lastResult));
+                                    while (!isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordParameters[0], ref isBreak, ref isContinue, ref isReturn, lastResult));
                                 }
                                 else
                                 {
@@ -1331,7 +1351,7 @@ void ExecuteBlocksStacks()
                         }
                         else if (keyword.Equals("while", StringComparisonForCasing))
                         {
-                            while (!isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[0], ref isBreak, ref isContinue, ref isReturn, lastResult))
+                            while (!isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordParameters[0], ref isBreak, ref isContinue, ref isReturn, lastResult))
                             {
                                 lastResult = ScriptEvaluate(subScript, ref isReturn, ref isBreak, ref isContinue);
 
@@ -1350,11 +1370,11 @@ void ExecuteBlocksStacks()
                         {
                             void forAction(int index)
                             {
-                                if (keywordAttributes.Count > index && !keywordAttributes[index].Trim().Equals(string.Empty))
-                                    ManageJumpStatementsOrExpressionEval(keywordAttributes[index], ref isBreak, ref isContinue, ref isReturn, lastResult);
+                                if (keywordParameters.Count > index && !keywordParameters[index].Trim().Equals(string.Empty))
+                                    ManageJumpStatementsOrExpressionEval(keywordParameters[index], ref isBreak, ref isContinue, ref isReturn, lastResult);
                             }
 
-                            for (forAction(0); !isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordAttributes[1], ref isBreak, ref isContinue, ref isReturn, lastResult); forAction(2))
+                            for (forAction(0); !isReturn && (bool)ManageJumpStatementsOrExpressionEval(keywordParameters[1], ref isBreak, ref isContinue, ref isReturn, lastResult); forAction(2))
                             {
                                 lastResult = ScriptEvaluate(subScript, ref isReturn, ref isBreak, ref isContinue);
 
@@ -1371,7 +1391,7 @@ void forAction(int index)
                         }
                         else if (keyword.Equals("foreach", StringComparisonForCasing))
                         {
-                            Match foreachParenthisEvaluationMatch = foreachParenthisEvaluationRegex.Match(keywordAttributes[0]);
+                            Match foreachParenthisEvaluationMatch = foreachParenthisEvaluationRegex.Match(keywordParameters[0]);
 
                             if (!foreachParenthisEvaluationMatch.Success)
                             {
@@ -3514,7 +3534,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                         }
                     }
 
-                    if (subExpr.StartsWith(startToken, StringComparisonForCasing))
+                    if (startToken != null && subExpr.StartsWith(startToken, StringComparisonForCasing))
                     {
                         bracketCount++;
                         i += startToken.Length - 1;
@@ -3991,7 +4011,7 @@ public enum OptionOnNoReturnKeywordFoundInScriptAction
         ThrowSyntaxException
     }
 
-    public enum SyntaxForHeadExpressionInScriptBlocksKeywords
+    public enum SyntaxForHeadStatementInBlocksKeywords
     {
         HeadBrackets,
         SeparatorBetweenHeadAndBlock,

From edc07a7795738c6babde1e96439d9ca17b72c167 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Mon, 18 Jan 2021 13:34:19 +0100
Subject: [PATCH 15/48] OptionScriptSyntaxForHeadStatementInBlocksKeywords for
 standard other values + Tests

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs | 151 ++++++++++++++++++
 .../Resources.Designer.cs                     |  64 ++++++++
 .../Resources.resx                            |  12 ++
 .../Resources/Script0075.txt                  |   2 +-
 .../Resources/Script0076.txt                  |   2 +-
 .../Resources/Script0077.txt                  |   7 +
 .../Resources/Script0078.txt                  |   9 ++
 .../Resources/Script0079.txt                  |   7 +
 .../Resources/Script0080.txt                  |   9 ++
 .../ExpressionEvaluator.cs                    |  25 ++-
 10 files changed, 280 insertions(+), 8 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0077.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0078.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0079.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0080.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 710f1ab..5da2fda 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1441,11 +1441,83 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0075, flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0076, flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0077, flexibleScriptSyntaxEvaluator02, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0078, flexibleScriptSyntaxEvaluator02, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .Returns(20);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator03 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Any
+                };
+
+                yield return new TestCaseData(Resources.Script0075, flexibleScriptSyntaxEvaluator03, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0076, flexibleScriptSyntaxEvaluator03, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0077, flexibleScriptSyntaxEvaluator03, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0078, flexibleScriptSyntaxEvaluator03, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0079, flexibleScriptSyntaxEvaluator03, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0080, flexibleScriptSyntaxEvaluator03, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .Returns(20);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator04 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
+                };
+
+                yield return new TestCaseData(Resources.Script0077, flexibleScriptSyntaxEvaluator04, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0078, flexibleScriptSyntaxEvaluator04, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
                     .Returns(20);
 
                 #endregion
@@ -1604,6 +1676,85 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
 
                 #endregion
 
+                #region Flexible script syntax that must throw Exception
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator01 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.HeadBrackets
+                };
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator01, Resources.Script0075.Replace("[infos]", "HeadBrackets"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.HeadBrackets")
+                    .SetCategory("Exception");
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator01, Resources.Script0076.Replace("[infos]", "HeadBrackets"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.HeadBrackets")
+                    .SetCategory("Exception");
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator01, Resources.Script0077.Replace("[infos]", "HeadBrackets"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.HeadBrackets")
+                    .SetCategory("Exception");
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator01, Resources.Script0078.Replace("[infos]", "HeadBrackets"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.HeadBrackets")
+                    .SetCategory("Exception");
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                };
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator02, Resources.Script0079.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .SetCategory("Exception");
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator02, Resources.Script0080.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .SetCategory("Exception");
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator03 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
+                };
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator03, Resources.Script0075.Replace("[infos]", "Both"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
+                    .SetCategory("Exception");
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator03, Resources.Script0076.Replace("[infos]", "Both"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
+                    .SetCategory("Exception");
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator03, Resources.Script0079.Replace("[infos]", "Both"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
+                    .SetCategory("Exception");
+
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator03, Resources.Script0080.Replace("[infos]", "Both"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
+                    .SetCategory("Exception");
+
+                #endregion
+
                 #region Throw Exception
 
                 yield return new TestCaseData(new ExpressionEvaluator(), Resources.Script0025, typeof(Exception), "Exception for test",null)
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index 8949992..82e3481 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1312,5 +1312,69 @@ public static string Script0076 {
                 return ResourceManager.GetString("Script0076", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0077 */
+        ///var myVar = 8;
+        ///
+        ///if (myVar &gt; 7): 
+        ///	myVar = 20;
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0077 {
+            get {
+                return ResourceManager.GetString("Script0077", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0078 */
+        ///var myVar = 8;
+        ///
+        ///if (myVar &gt; 7):
+        ///{
+        ///	myVar = 20;
+        ///}
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0078 {
+            get {
+                return ResourceManager.GetString("Script0078", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0079 */
+        ///var myVar = 8;
+        ///
+        ///if (myVar &gt; 7) 
+        ///	myVar = 20;
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0079 {
+            get {
+                return ResourceManager.GetString("Script0079", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0080 */
+        ///var myVar = 8;
+        ///
+        ///if (myVar &gt; 7)
+        ///{
+        ///	myVar = 20;
+        ///}
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0080 {
+            get {
+                return ResourceManager.GetString("Script0080", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index 79072ff..ea62f67 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -346,4 +346,16 @@
   <data name="Script0076" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0076.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0077" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0077.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0078" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0078.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0079" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0079.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0080" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0080.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0075.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0075.txt
index 39496b6..e61d363 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0075.txt
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0075.txt
@@ -1,4 +1,4 @@
-﻿/* Script0075 */
+﻿/* Script0075 [infos]*/
 var myVar = 8;
 
 if myVar > 7: 
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0076.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0076.txt
index 1b4e88c..5dd3cd5 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0076.txt
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0076.txt
@@ -1,4 +1,4 @@
-﻿/* Script0076 */
+﻿/* Script0076 [infos]*/
 var myVar = 8;
 
 if myVar > 7:
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0077.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0077.txt
new file mode 100644
index 0000000..ca22abe
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0077.txt
@@ -0,0 +1,7 @@
+﻿/* Script0077 [infos]*/
+var myVar = 8;
+
+if (myVar > 7): 
+	myVar = 20;
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0078.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0078.txt
new file mode 100644
index 0000000..b225d53
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0078.txt
@@ -0,0 +1,9 @@
+﻿/* Script0078 [infos]*/
+var myVar = 8;
+
+if (myVar > 7):
+{
+	myVar = 20;
+}
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0079.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0079.txt
new file mode 100644
index 0000000..2d9d1ee
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0079.txt
@@ -0,0 +1,7 @@
+﻿/* Script0079 [infos]*/
+var myVar = 8;
+
+if (myVar > 7) 
+	myVar = 20;
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0080.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0080.txt
new file mode 100644
index 0000000..560a640
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0080.txt
@@ -0,0 +1,9 @@
+﻿/* Script0080 [infos]*/
+var myVar = 8;
+
+if (myVar > 7)
+{
+	myVar = 20;
+}
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 863dda5..0184cef 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -67,6 +67,7 @@ public partial class ExpressionEvaluator
 
         // For script only
         protected Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)(?<startBracket>\()", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+        protected Regex blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>:)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
@@ -88,6 +89,7 @@ protected virtual void RefreshBlocksKeywordDetection()
                 startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
 
             blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator + ")", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         }
 
         /// <summary>
@@ -1193,13 +1195,24 @@ void ExecuteBlocksStacks()
 
                     if (blockKeywordsBeginingMatch.Success)
                     {
-                        if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
+                        if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                            || (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any && !blockKeywordsBeginingMatch.Groups["startBracket"].Success))
                         {
                             keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator, null, OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator);
                         }
                         else
                         {
                             keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator, OptionScriptBlocksKeywordsHeadStatementsStartBracket, OptionScriptBlocksKeywordsHeadExpressionEndBracket);
+
+                            if(OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.HeadBrackets)
+                            {
+                                Match blockKeywordsHeadAndBodySeparatorMatch = blockKeywordsHeadAndBodySeparatorRegex.Match(script.Substring(i + 1));
+
+                                if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Both && !blockKeywordsHeadAndBodySeparatorMatch.Success)
+                                    throw new ExpressionEvaluatorSyntaxErrorException($"A Separator Token [{OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator}] was expected after the [{keyword}] keyword head expression");
+
+                                i += blockKeywordsHeadAndBodySeparatorMatch.Length;
+                            }
                         }
 
                         i++;
@@ -2711,7 +2724,7 @@ protected virtual bool EvaluateParenthis(string expression, Stack<object> stack,
             string s = expression.Substring(i, 1);
 
             if (s.Equals(")"))
-                throw new Exception($"To much ')' characters are defined in expression : [{expression}] : no corresponding '(' fund.");
+                throw new ExpressionEvaluatorSyntaxErrorException($"To much ')' characters are defined in expression : [{expression}] : no corresponding '(' fund.");
 
             if (s.Equals("("))
             {
@@ -2797,7 +2810,7 @@ protected virtual bool EvaluateIndexing(string expression, Stack<object> stack,
                 if (bracketCount > 0)
                 {
                     string beVerb = bracketCount == 1 ? "is" : "are";
-                    throw new Exception($"{bracketCount} ']' character {beVerb} missing in expression : [{expression}]");
+                    throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} ']' character {beVerb} missing in expression : [{expression}]");
                 }
 
                 dynamic left = stack.Pop();
@@ -2967,7 +2980,7 @@ protected virtual bool EvaluateString(string expression, Stack<object> stack, re
                             if (bracketCount > 0)
                             {
                                 string beVerb = bracketCount == 1 ? "is" : "are";
-                                throw new Exception($"{bracketCount} '}}' character {beVerb} missing in expression : [{expression}]");
+                                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} '}}' character {beVerb} missing in expression : [{expression}]");
                             }
                             resultString.Append(Evaluate(innerExp.ToString()));
                         }
@@ -3489,7 +3502,7 @@ protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref
             if (bracketCount > 0)
             {
                 string beVerb = bracketCount == 1 ? "is" : "are";
-                throw new Exception($"{bracketCount} '" + "}" + $"' character {beVerb} missing in script at : [{index}]");
+                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} '" + "}" + $"' character {beVerb} missing in script at : [{index}]");
             }
 
             return currentScript;
@@ -3570,7 +3583,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
             if (bracketCount > 0)
             {
                 string beVerb = bracketCount == 1 ? "is" : "are";
-                throw new Exception($"{bracketCount} '{endToken}' character {beVerb} missing in expression : [{expression}]");
+                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} '{endToken}' character {beVerb} missing in expression : [{expression}]");
             }
 
             return expressionsList;

From 0fc06ef2ef014612510f634febae62661725ee50 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Mon, 18 Jan 2021 14:51:23 +0100
Subject: [PATCH 16/48] 
 OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket + Tests

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs | 102 +++++++++++++--
 .../Resources.Designer.cs                     | 123 +++++++++++++++++-
 .../Resources.resx                            |  21 +++
 .../Resources/Script0081.txt                  |   7 +
 .../Resources/Script0082.txt                  |   7 +
 .../Resources/Script0083.txt                  |   9 ++
 .../Resources/Script0084.txt                  |   7 +
 .../Resources/Script0085.txt                  |   9 ++
 .../Resources/Script0086.txt                  |   7 +
 .../Resources/Script0087.txt                  |   9 ++
 .../ExpressionEvaluator.cs                    |   1 +
 11 files changed, 284 insertions(+), 18 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0081.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0082.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0083.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0084.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0085.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0086.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0087.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 5da2fda..31fd083 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1438,25 +1438,31 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
                 };
 
-                yield return new TestCaseData(Resources.Script0075, flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0075.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0076, flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0076.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0077, flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0078, flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
@@ -1467,37 +1473,43 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Any
                 };
 
-                yield return new TestCaseData(Resources.Script0075, flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0075.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0076.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0076, flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0077, flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0078, flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0079.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0079, flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0080.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0080, flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
@@ -1508,18 +1520,78 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
                 };
 
-                yield return new TestCaseData(Resources.Script0077, flexibleScriptSyntaxEvaluator04, null, null, null)
+                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", "Both"), flexibleScriptSyntaxEvaluator04, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0078, flexibleScriptSyntaxEvaluator04, null, null, null)
+                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", "Both"), flexibleScriptSyntaxEvaluator04, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
                     .Returns(20);
 
+                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", "Both"), flexibleScriptSyntaxEvaluator04, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
+                    .Returns(20);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator05 = new ExpressionEvaluator()
+                {
+                    OptionScriptBlocksKeywordsHeadStatementsStartBracket = "|",
+                    OptionScriptBlocksKeywordsHeadExpressionEndBracket = "|"
+                };
+
+                yield return new TestCaseData(Resources.Script0082, flexibleScriptSyntaxEvaluator05, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0083, flexibleScriptSyntaxEvaluator05, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .Returns(20);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator06 = new ExpressionEvaluator()
+                {
+                    OptionScriptBlocksKeywordsHeadStatementsStartBracket = "{",
+                    OptionScriptBlocksKeywordsHeadExpressionEndBracket = "}"
+                };
+
+                yield return new TestCaseData(Resources.Script0084, flexibleScriptSyntaxEvaluator06, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0085, flexibleScriptSyntaxEvaluator06, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .Returns(20);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator07 = new ExpressionEvaluator()
+                {
+                    OptionScriptBlocksKeywordsHeadStatementsStartBracket = "<[",
+                    OptionScriptBlocksKeywordsHeadExpressionEndBracket = "]>"
+                };
+
+                yield return new TestCaseData(Resources.Script0086, flexibleScriptSyntaxEvaluator07, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0087, flexibleScriptSyntaxEvaluator07, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .Returns(20);
+
                 #endregion
 
                 #region For Bug correction (no regression)
@@ -1707,6 +1779,12 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.HeadBrackets")
                     .SetCategory("Exception");
 
+                yield return new TestCaseData(flexibleScriptSyntaxEvaluator01, Resources.Script0081.Replace("[infos]", "HeadBrackets"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.HeadBrackets")
+                    .SetCategory("Exception");
+
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
                 {
                     OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index 82e3481..d81547f 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1282,7 +1282,7 @@ public static string Script0074 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0075 */
+        ///   Looks up a localized string similar to /* Script0075 [infos]*/
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7: 
@@ -1297,7 +1297,7 @@ public static string Script0075 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0076 */
+        ///   Looks up a localized string similar to /* Script0076 [infos]*/
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7:
@@ -1314,7 +1314,7 @@ public static string Script0076 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0077 */
+        ///   Looks up a localized string similar to /* Script0077 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7): 
@@ -1329,7 +1329,7 @@ public static string Script0077 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0078 */
+        ///   Looks up a localized string similar to /* Script0078 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7):
@@ -1346,7 +1346,7 @@ public static string Script0078 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0079 */
+        ///   Looks up a localized string similar to /* Script0079 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7) 
@@ -1361,7 +1361,7 @@ public static string Script0079 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0080 */
+        ///   Looks up a localized string similar to /* Script0080 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7)
@@ -1376,5 +1376,116 @@ public static string Script0080 {
                 return ResourceManager.GetString("Script0080", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0081 [infos]*/
+        ///var myVar = 8;
+        ///
+        ///if (myVar &gt; 7)  : 
+        ///	myVar = 20;
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0081 {
+            get {
+                return ResourceManager.GetString("Script0081", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0082 */
+        ///var myVar = 8;
+        ///
+        ///if|myVar &gt; 7| 
+        ///	myVar = 20;
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0082 {
+            get {
+                return ResourceManager.GetString("Script0082", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0083 */
+        ///var myVar = 8;
+        ///
+        ///if |myVar &gt; 7|
+        ///{
+        ///	myVar = 20;
+        ///}
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0083 {
+            get {
+                return ResourceManager.GetString("Script0083", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0084 */
+        ///var myVar = 8;
+        ///
+        ///if {myVar &gt; 7}
+        ///	myVar = 20;
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0084 {
+            get {
+                return ResourceManager.GetString("Script0084", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0083 */
+        ///var myVar = 8;
+        ///
+        ///if {myVar &gt; 7}
+        ///{
+        ///	myVar = 20;
+        ///}
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0085 {
+            get {
+                return ResourceManager.GetString("Script0085", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0084 */
+        ///var myVar = 8;
+        ///
+        ///if {myVar &gt; 7}
+        ///	myVar = 20;
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0086 {
+            get {
+                return ResourceManager.GetString("Script0086", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0083 */
+        ///var myVar = 8;
+        ///
+        ///if {myVar &gt; 7}
+        ///{
+        ///	myVar = 20;
+        ///}
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0087 {
+            get {
+                return ResourceManager.GetString("Script0087", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index ea62f67..39852fd 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -358,4 +358,25 @@
   <data name="Script0080" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0080.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0081" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0081.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0082" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0082.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0083" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0083.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0084" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0084.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0085" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0085.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0086" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0086.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0087" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0087.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0081.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0081.txt
new file mode 100644
index 0000000..98983fc
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0081.txt
@@ -0,0 +1,7 @@
+﻿/* Script0081 [infos]*/
+var myVar = 8;
+
+if (myVar > 7)  : 
+	myVar = 20;
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0082.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0082.txt
new file mode 100644
index 0000000..b7d9e50
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0082.txt
@@ -0,0 +1,7 @@
+﻿/* Script0082 */
+var myVar = 8;
+
+if|myVar > 7| 
+	myVar = 20;
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0083.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0083.txt
new file mode 100644
index 0000000..b5ae982
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0083.txt
@@ -0,0 +1,9 @@
+﻿/* Script0083 */
+var myVar = 8;
+
+if |myVar > 7|
+{
+	myVar = 20;
+}
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0084.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0084.txt
new file mode 100644
index 0000000..a6fe576
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0084.txt
@@ -0,0 +1,7 @@
+﻿/* Script0084 */
+var myVar = 8;
+
+if {myVar > 7}
+	myVar = 20;
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0085.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0085.txt
new file mode 100644
index 0000000..a8273d4
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0085.txt
@@ -0,0 +1,9 @@
+﻿/* Script0083 */
+var myVar = 8;
+
+if {myVar > 7}
+{
+	myVar = 20;
+}
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0086.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0086.txt
new file mode 100644
index 0000000..7fcfadc
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0086.txt
@@ -0,0 +1,7 @@
+﻿/* Script0086 */
+var myVar = 8;
+
+if <[myVar > 7]>
+	myVar = 20;
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0087.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0087.txt
new file mode 100644
index 0000000..d154c61
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0087.txt
@@ -0,0 +1,9 @@
+﻿/* Script0087 */
+var myVar = 8;
+
+if <[myVar > 7]>
+{
+	myVar = 20;
+}
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 0184cef..560c17b 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -3539,6 +3539,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                     if (subExpr.StartsWith(endToken, StringComparisonForCasing))
                     {
                         bracketCount--;
+                        i += endToken.Length - 1;
                         if (bracketCount == 0)
                         {
                             if (!currentExpression.Trim().Equals(string.Empty))

From 3e0354cb86f2edd08cd0f577fb30bbdd62cda2ea Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Mon, 18 Jan 2021 16:02:45 +0100
Subject: [PATCH 17/48] OptionScriptBlockStartBrackets and
 OptionScriptBlockEndBrackets in progress

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs | 31 ++++++++++
 .../Resources.Designer.cs                     | 57 +++++++++++++++++--
 .../Resources.resx                            |  9 +++
 .../Resources/Script0088.txt                  |  7 +++
 .../Resources/Script0089.txt                  |  9 +++
 .../Resources/Script0090.txt                  |  9 +++
 .../ExpressionEvaluator.cs                    |  6 +-
 7 files changed, 121 insertions(+), 7 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0088.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0089.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0090.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 31fd083..cb31071 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1592,6 +1592,37 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
                     .Returns(20);
 
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator08 = new ExpressionEvaluator()
+                {
+                    OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator = "=>",
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                };
+
+                yield return new TestCaseData(Resources.Script0088, flexibleScriptSyntaxEvaluator08, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0089, flexibleScriptSyntaxEvaluator08, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
+                    .Returns(20);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator09 = new ExpressionEvaluator()
+                {
+                    OptionScriptBlockStartBrackets = "(",
+                    OptionScriptBlockEndBrackets = ")"
+                };
+
+                yield return new TestCaseData(Resources.Script0090, flexibleScriptSyntaxEvaluator09, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlockStartAndEndBrackets")
+                    .Returns(20);
+
+
                 #endregion
 
                 #region For Bug correction (no regression)
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index d81547f..562a93b 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1457,10 +1457,10 @@ public static string Script0085 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0084 */
+        ///   Looks up a localized string similar to /* Script0086 */
         ///var myVar = 8;
         ///
-        ///if {myVar &gt; 7}
+        ///if &lt;[myVar &gt; 7]&gt;
         ///	myVar = 20;
         ///
         ///return myVar;.
@@ -1472,10 +1472,10 @@ public static string Script0086 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0083 */
+        ///   Looks up a localized string similar to /* Script0087 */
         ///var myVar = 8;
         ///
-        ///if {myVar &gt; 7}
+        ///if &lt;[myVar &gt; 7]&gt;
         ///{
         ///	myVar = 20;
         ///}
@@ -1487,5 +1487,54 @@ public static string Script0087 {
                 return ResourceManager.GetString("Script0087", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0088 */
+        ///var myVar = 8;
+        ///
+        ///if myVar &gt; 7 =&gt;
+        ///	myVar = 20;
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0088 {
+            get {
+                return ResourceManager.GetString("Script0088", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0089 */
+        ///var myVar = 8;
+        ///
+        ///if myVar &gt; 7 =&gt;
+        ///{
+        ///	myVar = 20;
+        ///}
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0089 {
+            get {
+                return ResourceManager.GetString("Script0089", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0090 */
+        ///var myVar = 8;
+        ///
+        ///if (myVar &gt; 7)
+        ///(
+        ///	myVar = 20;
+        ///)
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0090 {
+            get {
+                return ResourceManager.GetString("Script0090", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index 39852fd..ab2129c 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -379,4 +379,13 @@
   <data name="Script0087" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0087.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0088" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0088.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0089" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0089.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0090" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0090.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0088.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0088.txt
new file mode 100644
index 0000000..a4566aa
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0088.txt
@@ -0,0 +1,7 @@
+﻿/* Script0088 */
+var myVar = 8;
+
+if myVar > 7 =>
+	myVar = 20;
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0089.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0089.txt
new file mode 100644
index 0000000..e10343a
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0089.txt
@@ -0,0 +1,9 @@
+﻿/* Script0089 */
+var myVar = 8;
+
+if myVar > 7 =>
+{
+	myVar = 20;
+}
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0090.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0090.txt
new file mode 100644
index 0000000..e24d66f
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0090.txt
@@ -0,0 +1,9 @@
+﻿/* Script0090 */
+var myVar = 8;
+
+if (myVar > 7)
+(
+	myVar = 20;
+)
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 560c17b..c7f8cf3 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -1,6 +1,6 @@
 /******************************************************************************************************
     Title : ExpressionEvaluator (https://github.com/codingseb/ExpressionEvaluator)
-    Version : 1.4.18.0 
+    Version : 1.4.18.2 
     (if last digit (the forth) is not a zero, the version is an intermediate version and can be unstable)
 
     Author : Coding Seb
@@ -89,7 +89,7 @@ protected virtual void RefreshBlocksKeywordDetection()
                 startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
 
             blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, RegexOptions.IgnoreCase | RegexOptions.Compiled);
-            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator + ")", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator) + ")", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         }
 
         /// <summary>
@@ -958,7 +958,7 @@ public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatement
         /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
         /// Default value : OptionalBracketsForStartAndEndWhenSingleStatement
         /// </summary>
-        public SyntaxForScriptBlocksIdentifier OptionSyntaxForScriptBlocksIdentifier { get; set; }
+        public SyntaxForScriptBlocksIdentifier OptionScriptSyntaxForBlocksIdentifier { get; set; }
 
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)

From 669909e526bfd465d8cdce9dbacb9b654356d573 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 19 Jan 2021 11:30:04 +0100
Subject: [PATCH 18/48] blocks of keywords detection with
 OptionScriptBlockStartBracket and OptionScriptBlockEndBracket OK

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs |  4 +-
 .../ExpressionEvaluator.cs                    | 57 +++++++++++++------
 2 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index cb31071..ab98925 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1612,8 +1612,8 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator09 = new ExpressionEvaluator()
                 {
-                    OptionScriptBlockStartBrackets = "(",
-                    OptionScriptBlockEndBrackets = ")"
+                    OptionScriptBlockStartBracket = "(",
+                    OptionScriptBlockEndBracket = ")"
                 };
 
                 yield return new TestCaseData(Resources.Script0090, flexibleScriptSyntaxEvaluator09, null, null, null)
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index c7f8cf3..0cad33b 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -67,12 +67,12 @@ public partial class ExpressionEvaluator
 
         // For script only
         protected Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)(?<startBracket>\()", RegexOptions.IgnoreCase | RegexOptions.Compiled);
-        protected Regex blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>:)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+        protected Regex blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>:)", RegexOptions.Compiled);
+        protected Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
+        protected Regex nextIsEndOfExpressionRegex = new Regex("^(;)", RegexOptions.Compiled);
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
-        protected static readonly Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
         protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s+)|(?=\())", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
-        protected Regex nextIsEndOfExpressionRegex = new Regex("^(;)", RegexOptions.Compiled);
 
         /// <summary>
         /// Rebuild some Regex to detect blocks keywords in script
@@ -88,8 +88,13 @@ protected virtual void RefreshBlocksKeywordDetection()
             if(OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
                 startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
 
-            blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, RegexOptions.IgnoreCase | RegexOptions.Compiled);
-            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator) + ")", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+        }
+
+        protected virtual void RefreshBlockDetection()
+        {
+            blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionScriptBlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         /// <summary>
@@ -97,9 +102,11 @@ protected virtual void RefreshBlocksKeywordDetection()
         /// </summary>
         protected virtual void RefreshEndOfExpressionDetection()
         {
-            nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
+        protected RegexOptions CompiledRegexOptionAndIfNecessaryIgnoreCase => OptionCaseSensitiveEvaluationActive ? RegexOptions.Compiled : RegexOptions.IgnoreCase | RegexOptions.Compiled;
+
         #endregion
 
         #region enums 
@@ -614,6 +621,9 @@ public bool OptionCaseSensitiveEvaluationActive
                 simpleDoubleMathFuncsDictionary = new Dictionary<string, Func<double, double>>(simpleDoubleMathFuncsDictionary, StringComparerForCasing);
                 doubleDoubleMathFuncsDictionary = new Dictionary<string, Func<double, double, double>>(doubleDoubleMathFuncsDictionary, StringComparerForCasing);
                 complexStandardFuncsDictionary = new Dictionary<string, Func<ExpressionEvaluator, List<string>, object>>(complexStandardFuncsDictionary, StringComparerForCasing);
+                RefreshBlockDetection();
+                RefreshBlocksKeywordDetection();
+                RefreshEndOfExpressionDetection();
             }
         }
 
@@ -942,17 +952,26 @@ public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatement
             }
         }
 
+        private string optionScriptBlockStartBrackets = "{";
         /// <summary>
         /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
         /// Default value : <c>"{"</c>
         /// </summary>
-        public string OptionScriptBlockStartBrackets { get; set; } = "{";
+        public string OptionScriptBlockStartBracket
+        {
+            get { return optionScriptBlockStartBrackets; }
+            set
+            {
+                optionScriptBlockStartBrackets = value;
+                RefreshBlockDetection();
+            }
+        }
 
         /// <summary>
         /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
         /// Default value : <c>"}"</c>
         /// </summary>
-        public string OptionScriptBlockEndBrackets { get; set; } = "}";
+        public string OptionScriptBlockEndBracket { get; set; } = "}";
 
         /// <summary>
         /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
@@ -1226,7 +1245,7 @@ void ExecuteBlocksStacks()
                     {
                         i += blockBeginningMatch.Length;
 
-                        subScript = GetScriptBetweenCurlyBrackets(script, ref i);
+                        subScript = GetScriptBetweenCurlyBrackets(script, ref i, OptionScriptBlockStartBracket, OptionScriptBlockEndBracket);
 
                         i++;
                     }
@@ -3461,7 +3480,7 @@ protected virtual BindingFlags DetermineInstanceOrStatic(ref Type objType, ref o
             }
         }
 
-        protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref int index)
+        protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref int index, string startBracket = "{", string endBracket = "}")
         {
             string s;
             string currentScript = string.Empty;
@@ -3484,18 +3503,24 @@ protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref
                 }
                 else
                 {
-                    s = parentScript.Substring(index, 1);
-
-                    if (s.Equals("{")) bracketCount++;
+                    s = parentScript.Substring(index);
 
-                    if (s.Equals("}"))
+                    if (s.StartsWith(startBracket))
+                    {
+                        bracketCount++;
+                        index += startBracket.Length - 1;
+                    }
+                    else if (s.StartsWith(endBracket))
                     {
                         bracketCount--;
+                        index += endBracket.Length - 1;
                         if (bracketCount == 0)
                             break;
                     }
-
-                    currentScript += s;
+                    else
+                    {
+                        currentScript += parentScript.Substring(index,1);
+                    }
                 }
             }
 

From 4570c8f1a720371bb83b48f92b7860bb85435592 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 19 Jan 2021 13:42:22 +0100
Subject: [PATCH 19/48] pascal syntax problem

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs | 26 ++++++++++++++
 .../Resources.Designer.cs                     | 35 +++++++++++++++++++
 .../Resources.resx                            |  6 ++++
 .../Resources/Script0091.txt                  |  9 +++++
 .../Resources/Script0092.txt                  | 10 ++++++
 .../ExpressionEvaluator.cs                    |  6 ++--
 6 files changed, 89 insertions(+), 3 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0091.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0092.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index ab98925..90dd4d2 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1622,6 +1622,32 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("OptionScriptBlockStartAndEndBrackets")
                     .Returns(20);
 
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator10 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
+                    OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator = "then",
+                    OptionScriptBlockStartBracket = "begin",
+                    OptionScriptBlockEndBracket = "end"
+                };
+
+                yield return new TestCaseData(Resources.Script0091, flexibleScriptSyntaxEvaluator10, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlockStartAndEndBrackets")
+                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
+                    .SetCategory("SeparatorBetweenHeadAndBlock")
+                    .SetCategory("PascalSyntax")
+                    .Returns(20);
+
+                yield return new TestCaseData(Resources.Script0092, flexibleScriptSyntaxEvaluator10, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlockStartAndEndBrackets")
+                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
+                    .SetCategory("SeparatorBetweenHeadAndBlock")
+                    .SetCategory("PascalSyntax")
+                    .Returns(20);
+
 
                 #endregion
 
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index 562a93b..0f4fbf1 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1536,5 +1536,40 @@ public static string Script0090 {
                 return ResourceManager.GetString("Script0090", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0091 */
+        ///var myVar = 8;
+        ///
+        ///if myVar &gt; 7 then
+        ///begin
+        ///	myVar = 20;
+        ///end
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0091 {
+            get {
+                return ResourceManager.GetString("Script0091", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0092 */
+        ///var myVar = 8;
+        ///
+        ///if myVar &gt; 7 then
+        ///begin
+        ///	myVar = 20;
+        ///	var ItIsTheEndOfWorkingWell = myVar + 2;
+        ///end
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0092 {
+            get {
+                return ResourceManager.GetString("Script0092", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index ab2129c..e94f6ca 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -388,4 +388,10 @@
   <data name="Script0090" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0090.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0091" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0091.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0092" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0092.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0091.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0091.txt
new file mode 100644
index 0000000..c472aad
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0091.txt
@@ -0,0 +1,9 @@
+﻿/* Script0091 */
+var myVar = 8;
+
+if myVar > 7 then
+begin
+	myVar = 20;
+end
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0092.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0092.txt
new file mode 100644
index 0000000..e8747cb
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0092.txt
@@ -0,0 +1,10 @@
+﻿/* Script0092 */
+var myVar = 8;
+
+if myVar > 7 then
+begin
+	myVar = 20;
+	var ItIsThe_end_OfWorkingWell = myVar + 2;
+end
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 0cad33b..2dbf549 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -1256,7 +1256,7 @@ void ExecuteBlocksStacks()
 
                         while (i < script.Length && continueExpressionParsing)
                         {
-                            if (TryParseStringAndParenthisAndCurlyBrackets(script, ref i)) { }
+                            if (TryParseStringAndParenthesesAndCurlyBrackets(script, ref i)) { }
                             else if (script.Length - i >= 3 && OptionScriptEndOfExpression.Any( o =>  o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
                             {
                                 i += 2;
@@ -1465,7 +1465,7 @@ void forAction(int index)
 
                     Match nextIsEndOfExpressionMatch;
 
-                    if (TryParseStringAndParenthisAndCurlyBrackets(script, ref i)) { }
+                    if (TryParseStringAndParenthesesAndCurlyBrackets(script, ref i)) { }
                     else if (script.Length - i >= 3 && OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
                     {
                         i += 2;
@@ -1635,7 +1635,7 @@ protected virtual object ManageJumpStatementsOrExpressionEval(string expression,
             return Evaluate(expression);
         }
 
-        protected virtual bool TryParseStringAndParenthisAndCurlyBrackets(string script, ref int index)
+        protected virtual bool TryParseStringAndParenthesesAndCurlyBrackets(string script, ref int index)
         {
             bool parsed = true;
             Match internalStringMatch = stringBeginningRegex.Match(script.Substring(index));

From eeb00b5e9bba1a49b95b0c282eeba205fa399928 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 19 Jan 2021 14:33:09 +0100
Subject: [PATCH 20/48] Refactoring + One more test

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs |  8 ++++++++
 .../GlobalSuppressions.cs                     | 13 ++++++++++++
 .../Resources.Designer.cs                     | 20 ++++++++++++++++++-
 .../Resources.resx                            |  3 +++
 .../Resources/Script0093.txt                  | 10 ++++++++++
 .../ClassWithNonPublicMembersAndMethods.cs    |  9 ---------
 .../ExpressionEvaluator.cs                    |  4 ++--
 7 files changed, 55 insertions(+), 12 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/GlobalSuppressions.cs
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0093.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 90dd4d2..335fb28 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1648,6 +1648,14 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("PascalSyntax")
                     .Returns(20);
 
+                yield return new TestCaseData(Resources.Script0093, flexibleScriptSyntaxEvaluator10, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionScriptBlockStartAndEndBrackets")
+                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
+                    .SetCategory("SeparatorBetweenHeadAndBlock")
+                    .SetCategory("PascalSyntax")
+                    .Returns(20);
 
                 #endregion
 
diff --git a/CodingSeb.ExpressionEvaluator.Tests/GlobalSuppressions.cs b/CodingSeb.ExpressionEvaluator.Tests/GlobalSuppressions.cs
new file mode 100644
index 0000000..863bce3
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/GlobalSuppressions.cs
@@ -0,0 +1,13 @@
+﻿// This file is used by Code Analysis to maintain SuppressMessage
+// attributes that are applied to this project.
+// Project-level suppressions either have no target or are given
+// a specific target and scoped to a namespace, type, member, etc.
+
+using System.Diagnostics.CodeAnalysis;
+
+[assembly: SuppressMessage("Design", "RCS1169:Make field read-only.", Justification = "<Pending>", Scope = "namespaceanddescendants", Target = "~N:CodingSeb.ExpressionEvaluator.Tests")]
+[assembly: SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "<Pending>", Scope = "namespaceanddescendants", Target = "~N:CodingSeb.ExpressionEvaluator.Tests")]
+[assembly: SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "namespaceanddescendants", Target = "~N:CodingSeb.ExpressionEvaluator.Tests")]
+[assembly: SuppressMessage("Redundancy", "RCS1213:Remove unused member declaration.", Justification = "<Pending>", Scope = "namespaceanddescendants", Target = "~N:CodingSeb.ExpressionEvaluator.Tests")]
+[assembly: SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "namespaceanddescendants", Target = "~N:CodingSeb.ExpressionEvaluator.Tests")]
+[assembly: SuppressMessage("Design", "RCS1170:Use read-only auto-implemented property.", Justification = "<Pending>", Scope = "namespaceanddescendants", Target = "~N:CodingSeb.ExpressionEvaluator.Tests")]
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index 0f4fbf1..ab5ea56 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1561,7 +1561,7 @@ public static string Script0091 {
         ///if myVar &gt; 7 then
         ///begin
         ///	myVar = 20;
-        ///	var ItIsTheEndOfWorkingWell = myVar + 2;
+        ///	var ItIsThe_end_OfWorkingWell = myVar + 2;
         ///end
         ///
         ///return myVar;.
@@ -1571,5 +1571,23 @@ public static string Script0092 {
                 return ResourceManager.GetString("Script0092", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0093 */
+        ///var myVar = 8;
+        ///
+        ///if myVar &gt; 7 then
+        ///begin
+        ///	myVar = 20;
+        ///	var ItIsThe_begining_OfProblems = myVar + 2;
+        ///end
+        ///
+        ///return myVar;.
+        /// </summary>
+        public static string Script0093 {
+            get {
+                return ResourceManager.GetString("Script0093", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index e94f6ca..a5570a6 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -394,4 +394,7 @@
   <data name="Script0092" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0092.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0093" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0093.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0093.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0093.txt
new file mode 100644
index 0000000..65aaa7f
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0093.txt
@@ -0,0 +1,10 @@
+﻿/* Script0093 */
+var myVar = 8;
+
+if myVar > 7 then
+begin
+	myVar = 20;
+	var ItIsThe_begining_OfProblems = myVar + 2;
+end
+
+return myVar;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/ClassWithNonPublicMembersAndMethods.cs b/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/ClassWithNonPublicMembersAndMethods.cs
index 241b34c..36a7b9a 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/ClassWithNonPublicMembersAndMethods.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/ClassWithNonPublicMembersAndMethods.cs
@@ -2,23 +2,14 @@
 {
     public class ClassWithNonPublicMembersAndMethods
     {
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "RCS1169:Make field read-only.", Justification = "<Pending>")]
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1213:Remove unused member declaration.", Justification = "<Pending>")]
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "<Pending>")]
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>")]
         private int myPrivateField = 5;
 
         protected int myProtectedField = 10;
 
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "RCS1170:Use read-only auto-implemented property.", Justification = "<Pending>")]
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1213:Remove unused member declaration.", Justification = "<Pending>")]
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>")]
         private int MyPrivateProperty { get; set; } = 15;
 
         protected int MyProtectedProperty { get; set; } = 20;
 
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1213:Remove unused member declaration.", Justification = "<Pending>")]
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>")]
         private string MyPrivateMethod(string name)
         {
             return "Hello " + name;
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 2dbf549..8ab51f2 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -3527,7 +3527,8 @@ protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref
             if (bracketCount > 0)
             {
                 string beVerb = bracketCount == 1 ? "is" : "are";
-                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} '" + "}" + $"' character {beVerb} missing in script at : [{index}]");
+                string singularPlurial = bracketCount == 1 ? "" : "s";
+                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} [{endBracket}] (end of block) token{singularPlurial} {beVerb} missing in script at : [{index}]");
             }
 
             return currentScript;
@@ -3537,7 +3538,6 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
         {
             List<string> expressionsList = new List<string>();
 
-            string s;
             string currentExpression = string.Empty;
             int bracketCount = 1;
             for (; i < expression.Length; i++)

From 67aef136b70e8539349246e0adf8418fcba32ba6 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 20 Jan 2021 15:48:09 +0100
Subject: [PATCH 21/48] Reflection in progress

---
 .../ExpressionEvaluator.cs                    | 31 +++++++++++++++++--
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 8ab51f2..dc921b9 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -68,8 +68,10 @@ public partial class ExpressionEvaluator
         // For script only
         protected Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)(?<startBracket>\()", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected Regex blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>:)", RegexOptions.Compiled);
-        protected Regex blockBeginningRegex = new Regex(@"^(?>\s*)[{]", RegexOptions.Compiled);
+        protected Regex blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>[{])", RegexOptions.Compiled);
         protected Regex nextIsEndOfExpressionRegex = new Regex("^(;)", RegexOptions.Compiled);
+        protected static readonly Regex wordTypeTokenDetectionRegex = new Regex(@"^(?>[\p{L}_0-9]+)$", RegexOptions.Compiled);
+        protected static readonly Regex wordTypeTokenBoundaryValidation = new Regex(@"[^\p{L}_0-9.]");
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s+)|(?=\())", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
@@ -95,6 +97,8 @@ protected virtual void RefreshBlocksKeywordDetection()
         protected virtual void RefreshBlockDetection()
         {
             blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionScriptBlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(OptionScriptBlockStartBracket);
+            blockEndBracketIsAWord = wordTypeTokenDetectionRegex.IsMatch(OptionScriptBlockEndBracket);
         }
 
         /// <summary>
@@ -105,6 +109,9 @@ protected virtual void RefreshEndOfExpressionDetection()
             nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
+        protected bool isBlockStartBracketAWord = false;
+        protected bool blockEndBracketIsAWord = false;
+
         protected RegexOptions CompiledRegexOptionAndIfNecessaryIgnoreCase => OptionCaseSensitiveEvaluationActive ? RegexOptions.Compiled : RegexOptions.IgnoreCase | RegexOptions.Compiled;
 
         #endregion
@@ -967,11 +974,20 @@ public string OptionScriptBlockStartBracket
             }
         }
 
+        private string optionScriptBlockEndBracket = "}";
         /// <summary>
         /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
         /// Default value : <c>"}"</c>
         /// </summary>
-        public string OptionScriptBlockEndBracket { get; set; } = "}";
+        public string OptionScriptBlockEndBracket
+        {
+            get { return optionScriptBlockEndBracket; }
+            set
+            {
+                optionScriptBlockEndBracket = value;
+                RefreshBlockDetection();
+            }
+        }
 
         /// <summary>
         /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
@@ -1241,7 +1257,8 @@ void ExecuteBlocksStacks()
 
                     string subScript = string.Empty;
 
-                    if (blockBeginningMatch.Success)
+                    if (blockBeginningMatch.Success &&
+                        (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, i + blockBeginningMatch.Groups["startBracket"].Index - 1, i + blockBeginningMatch.Length)))
                     {
                         i += blockBeginningMatch.Length;
 
@@ -3480,6 +3497,14 @@ protected virtual BindingFlags DetermineInstanceOrStatic(ref Type objType, ref o
             }
         }
 
+        protected bool ValidateKeywordBoundaries(string script, int startBoundary, int endBoundary)
+        {
+            return startBoundary >= 0 &&
+                wordTypeTokenBoundaryValidation.IsMatch(script.Substring(startBoundary, 1)) &&
+                endBoundary < script.Length &&
+                wordTypeTokenBoundaryValidation.IsMatch(script.Substring(startBoundary, 1));
+        }
+
         protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref int index, string startBracket = "{", string endBracket = "}")
         {
             string s;

From 6c33f66fdc0e68af4c4fb1417f16d325fc1492c3 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Thu, 21 Jan 2021 12:00:27 +0100
Subject: [PATCH 22/48] Pascal syntax work better

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs |  2 ++
 .../ExpressionEvaluator.cs                    | 26 +++++++++----------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 335fb28..cd815d0 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1630,6 +1630,8 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     OptionScriptBlockEndBracket = "end"
                 };
 
+                flexibleScriptSyntaxEvaluator10.ImbricableBracketsPairing["begin"] = "end";
+
                 yield return new TestCaseData(Resources.Script0091, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index dc921b9..e09985d 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -98,7 +98,7 @@ protected virtual void RefreshBlockDetection()
         {
             blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionScriptBlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
             isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(OptionScriptBlockStartBracket);
-            blockEndBracketIsAWord = wordTypeTokenDetectionRegex.IsMatch(OptionScriptBlockEndBracket);
+            isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(OptionScriptBlockEndBracket);
         }
 
         /// <summary>
@@ -110,7 +110,7 @@ protected virtual void RefreshEndOfExpressionDetection()
         }
 
         protected bool isBlockStartBracketAWord = false;
-        protected bool blockEndBracketIsAWord = false;
+        protected bool isBlockEndBracketAWord = false;
 
         protected RegexOptions CompiledRegexOptionAndIfNecessaryIgnoreCase => OptionCaseSensitiveEvaluationActive ? RegexOptions.Compiled : RegexOptions.IgnoreCase | RegexOptions.Compiled;
 
@@ -1262,7 +1262,7 @@ void ExecuteBlocksStacks()
                     {
                         i += blockBeginningMatch.Length;
 
-                        subScript = GetScriptBetweenCurlyBrackets(script, ref i, OptionScriptBlockStartBracket, OptionScriptBlockEndBracket);
+                        subScript = GetScriptBetweenBlockBrackets(script, ref i);
 
                         i++;
                     }
@@ -1667,10 +1667,10 @@ protected virtual bool TryParseStringAndParenthesesAndCurlyBrackets(string scrip
                 index++;
                 GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref index, false);
             }
-            else if (script[index] == '{')
+            else if (script.Substring(index).StartsWith(OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, index - 1, index + OptionScriptBlockStartBracket.Length)))
             {
-                index++;
-                GetScriptBetweenCurlyBrackets(script, ref index);
+                index+=OptionScriptBlockStartBracket.Length;
+                GetScriptBetweenBlockBrackets(script, ref index);
             }
             else
             {
@@ -3502,10 +3502,10 @@ protected bool ValidateKeywordBoundaries(string script, int startBoundary, int e
             return startBoundary >= 0 &&
                 wordTypeTokenBoundaryValidation.IsMatch(script.Substring(startBoundary, 1)) &&
                 endBoundary < script.Length &&
-                wordTypeTokenBoundaryValidation.IsMatch(script.Substring(startBoundary, 1));
+                wordTypeTokenBoundaryValidation.IsMatch(script.Substring(endBoundary, 1));
         }
 
-        protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref int index, string startBracket = "{", string endBracket = "}")
+        protected virtual string GetScriptBetweenBlockBrackets(string parentScript, ref int index)
         {
             string s;
             string currentScript = string.Empty;
@@ -3530,15 +3530,15 @@ protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref
                 {
                     s = parentScript.Substring(index);
 
-                    if (s.StartsWith(startBracket))
+                    if (s.StartsWith(OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionScriptBlockStartBracket.Length)))
                     {
                         bracketCount++;
-                        index += startBracket.Length - 1;
+                        index += OptionScriptBlockStartBracket.Length - 1;
                     }
-                    else if (s.StartsWith(endBracket))
+                    else if (s.StartsWith(OptionScriptBlockEndBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionScriptBlockEndBracket.Length)))
                     {
                         bracketCount--;
-                        index += endBracket.Length - 1;
+                        index += OptionScriptBlockEndBracket.Length - 1;
                         if (bracketCount == 0)
                             break;
                     }
@@ -3553,7 +3553,7 @@ protected virtual string GetScriptBetweenCurlyBrackets(string parentScript, ref
             {
                 string beVerb = bracketCount == 1 ? "is" : "are";
                 string singularPlurial = bracketCount == 1 ? "" : "s";
-                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} [{endBracket}] (end of block) token{singularPlurial} {beVerb} missing in script at : [{index}]");
+                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} [{OptionScriptBlockEndBracket}] (end of block) token{singularPlurial} {beVerb} missing in script at : [{index}]");
             }
 
             return currentScript;

From 7c3dcc0d68e75662669ec3e12d110c373d601fd2 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 22 Jan 2021 13:34:23 +0100
Subject: [PATCH 23/48] new keyword remapping (#78) + Tests

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs | 12 ++++++
 .../Resources.Designer.cs                     | 30 ++++++++++++++
 .../Resources.resx                            |  6 +++
 .../Resources/Script0094.txt                  |  7 ++++
 .../Resources/Script0095.txt                  |  7 ++++
 .../ExpressionEvaluator.cs                    | 40 ++++++++++++++-----
 6 files changed, 92 insertions(+), 10 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0094.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0095.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index cd815d0..e7bfec3 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1659,6 +1659,18 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("PascalSyntax")
                     .Returns(20);
 
+                yield return new TestCaseData(Resources.Script0094, new ExpressionEvaluator() {OptionKeywordForInstanceCreation = "->" }, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionKeywordForInstanceCreation")
+                    .Returns(2);
+
+                yield return new TestCaseData(Resources.Script0095, new ExpressionEvaluator() {OptionKeywordForInstanceCreation = "create" }, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory("OptionKeywordForInstanceCreation")
+                    .Returns(2);
+
                 #endregion
 
                 #region For Bug correction (no regression)
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index ab5ea56..0eb1e3a 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1589,5 +1589,35 @@ public static string Script0093 {
                 return ResourceManager.GetString("Script0093", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0094 */
+        ///myList = -&gt; List&lt;int&gt;()
+        ///{
+        ///	2
+        ///};
+        ///
+        ///return myList[0];.
+        /// </summary>
+        public static string Script0094 {
+            get {
+                return ResourceManager.GetString("Script0094", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0095 */
+        ///myList = create List&lt;int&gt;()
+        ///{
+        ///	2
+        ///};
+        ///
+        ///return myList[0];.
+        /// </summary>
+        public static string Script0095 {
+            get {
+                return ResourceManager.GetString("Script0095", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index a5570a6..501bf9e 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -397,4 +397,10 @@
   <data name="Script0093" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0093.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0094" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0094.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0095" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0095.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0094.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0094.txt
new file mode 100644
index 0000000..947e4ed
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0094.txt
@@ -0,0 +1,7 @@
+﻿/* Script0094 */
+myList = -> List<int>()
+{
+	2
+};
+
+return myList[0];
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0095.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0095.txt
new file mode 100644
index 0000000..c2c979e
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0095.txt
@@ -0,0 +1,7 @@
+﻿/* Script0095 */
+myList = create List<int>()
+{
+	2
+};
+
+return myList[0];
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index e09985d..e3d8f89 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -55,6 +55,7 @@ public partial class ExpressionEvaluator
 
         // Depending on OptionInlineNamespacesEvaluationActive. Initialized in constructor
         protected string InstanceCreationWithNewKeywordRegexPattern { get { return @"^new(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9"+ (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))"; } }
+        protected Regex instanceCreationKeywordRegexPattern = new Regex(@"^new(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9\.]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", RegexOptions.Compiled);
         protected string CastRegexPattern { get { return @"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9"+ (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"\[\]<>]*[?]?)(?>\s*)\)"; } }
 
         // To remove comments in scripts based on https://stackoverflow.com/questions/3524317/regex-to-strip-line-comments-from-c-sharp/3524689#3524689
@@ -97,8 +98,6 @@ protected virtual void RefreshBlocksKeywordDetection()
         protected virtual void RefreshBlockDetection()
         {
             blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionScriptBlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
-            isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(OptionScriptBlockStartBracket);
-            isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(OptionScriptBlockEndBracket);
         }
 
         /// <summary>
@@ -109,8 +108,10 @@ protected virtual void RefreshEndOfExpressionDetection()
             nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
-        protected bool isBlockStartBracketAWord = false;
-        protected bool isBlockEndBracketAWord = false;
+        protected virtual void RefreshInstanceCreationKeywordRegexPattern()
+        {
+            instanceCreationKeywordRegexPattern = new Regex("^"+ OptionKeywordForInstanceCreation  + @"(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+        }
 
         protected RegexOptions CompiledRegexOptionAndIfNecessaryIgnoreCase => OptionCaseSensitiveEvaluationActive ? RegexOptions.Compiled : RegexOptions.IgnoreCase | RegexOptions.Compiled;
 
@@ -631,6 +632,7 @@ public bool OptionCaseSensitiveEvaluationActive
                 RefreshBlockDetection();
                 RefreshBlocksKeywordDetection();
                 RefreshEndOfExpressionDetection();
+                RefreshInstanceCreationKeywordRegexPattern();
             }
         }
 
@@ -796,6 +798,20 @@ public bool OptionNewFunctionEvaluationActive
         /// </summary>
         public bool OptionNewKeywordEvaluationActive { get; set; } = true;
 
+        /// <summary>
+        /// To specify the keyword/operator that is used to create instance of object.
+        /// Default value : "new"
+        /// </summary>
+        public string OptionKeywordForInstanceCreation
+        {
+            get { return optionKeywordForInstanceCreation; }
+            set
+            {
+                optionKeywordForInstanceCreation = value;
+                RefreshInstanceCreationKeywordRegexPattern();
+            }
+        }
+
         /// <summary>
         /// if <c>true</c> allow to call static methods on classes.
         /// if <c>false</c> unactive this functionality.
@@ -959,21 +975,24 @@ public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatement
             }
         }
 
-        private string optionScriptBlockStartBrackets = "{";
+        protected bool isBlockStartBracketAWord;
+        private string optionScriptBlockStartBracket = "{";
         /// <summary>
         /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
         /// Default value : <c>"{"</c>
         /// </summary>
         public string OptionScriptBlockStartBracket
         {
-            get { return optionScriptBlockStartBrackets; }
+            get { return optionScriptBlockStartBracket; }
             set
             {
-                optionScriptBlockStartBrackets = value;
+                optionScriptBlockStartBracket = value;
+                isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
                 RefreshBlockDetection();
             }
         }
 
+        protected bool isBlockEndBracketAWord;
         private string optionScriptBlockEndBracket = "}";
         /// <summary>
         /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
@@ -985,7 +1004,7 @@ public string OptionScriptBlockEndBracket
             set
             {
                 optionScriptBlockEndBracket = value;
-                RefreshBlockDetection();
+                isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockEndBracket);
             }
         }
 
@@ -1543,6 +1562,7 @@ public T Evaluate<T>(string expression)
         }
 
         private IList<ParsingMethodDelegate> parsingMethods;
+        private string optionKeywordForInstanceCreation = "new";
 
         protected virtual IList<ParsingMethodDelegate> ParsingMethods => parsingMethods ?? (parsingMethods = new List<ParsingMethodDelegate>()
         {
@@ -1860,7 +1880,7 @@ protected virtual bool EvaluateInstanceCreationWithNewKeyword(string expression,
             if (!OptionNewKeywordEvaluationActive)
                 return false;
 
-            Match instanceCreationMatch = Regex.Match(expression.Substring(i), InstanceCreationWithNewKeywordRegexPattern, optionCaseSensitiveEvaluationActive ? RegexOptions.None : RegexOptions.IgnoreCase);
+            Match instanceCreationMatch = instanceCreationKeywordRegexPattern.Match(expression.Substring(i));
 
             if (instanceCreationMatch.Success
                 && (stack.Count == 0
@@ -4098,7 +4118,7 @@ public enum SyntaxForScriptBlocksIdentifier
 
     public partial class ExpressionOperator : IEquatable<ExpressionOperator>
     {
-        protected static uint indexer = 0;
+        protected static uint indexer;
 
         protected ExpressionOperator()
         {

From 71f3de20c1283b1b2578ec16896f4ea77c79f37b Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 22 Jan 2021 13:57:20 +0100
Subject: [PATCH 24/48] OptionKeywordForInstanceCreation =>
 OptionNewKeywordAliases for more possibilities (#78) + Some tests refactoring

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs | 116 ++++++++++--------
 .../Resources/Script0095.txt                  |   7 +-
 .../ExpressionEvaluator.cs                    |  14 +--
 3 files changed, 77 insertions(+), 60 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index e7bfec3..20e34b8 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1430,7 +1430,7 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0074, flexibleScriptSyntaxEvaluator01, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptEndOfExpression")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptEndOfExpression))
                     .Returns(8);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
@@ -1438,34 +1438,34 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
                 };
 
-                yield return new TestCaseData(Resources.Script0075.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0075.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0076.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0076.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), flexibleScriptSyntaxEvaluator02, null, null, null)
+                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)), flexibleScriptSyntaxEvaluator02, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator03 = new ExpressionEvaluator()
@@ -1473,46 +1473,46 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Any
                 };
 
-                yield return new TestCaseData(Resources.Script0075.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0075.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Any)), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.Any))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0076.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0076.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Any)), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.Any))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Any)), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.Any))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Any)), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.Any))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0079.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0079.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Any)), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.Any))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0080.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0080.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Any)), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.Any))
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", "Any"), flexibleScriptSyntaxEvaluator03, null, null, null)
+                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Any)), flexibleScriptSyntaxEvaluator03, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Any")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.Any))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator04 = new ExpressionEvaluator()
@@ -1520,22 +1520,22 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
                 };
 
-                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", "Both"), flexibleScriptSyntaxEvaluator04, null, null, null)
+                yield return new TestCaseData(Resources.Script0077.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Both)), flexibleScriptSyntaxEvaluator04, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", "Both"), flexibleScriptSyntaxEvaluator04, null, null, null)
+                yield return new TestCaseData(Resources.Script0078.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Both)), flexibleScriptSyntaxEvaluator04, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", "Both"), flexibleScriptSyntaxEvaluator04, null, null, null)
+                yield return new TestCaseData(Resources.Script0081.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Both)), flexibleScriptSyntaxEvaluator04, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("SyntaxForHeadStatementInBlocksKeywords.Both")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.Both))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator05 = new ExpressionEvaluator()
@@ -1547,13 +1547,15 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0082, flexibleScriptSyntaxEvaluator05, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0083, flexibleScriptSyntaxEvaluator05, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator06 = new ExpressionEvaluator()
@@ -1565,13 +1567,15 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0084, flexibleScriptSyntaxEvaluator06, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0085, flexibleScriptSyntaxEvaluator06, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator07 = new ExpressionEvaluator()
@@ -1583,13 +1587,15 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0086, flexibleScriptSyntaxEvaluator07, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0087, flexibleScriptSyntaxEvaluator07, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlocksKeywordsHeadStatementsStartAndEndBracket")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator08 = new ExpressionEvaluator()
@@ -1601,13 +1607,15 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0088, flexibleScriptSyntaxEvaluator08, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0089, flexibleScriptSyntaxEvaluator08, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator09 = new ExpressionEvaluator()
@@ -1619,7 +1627,8 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0090, flexibleScriptSyntaxEvaluator09, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlockStartAndEndBrackets")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator10 = new ExpressionEvaluator()
@@ -1635,41 +1644,44 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0091, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlockStartAndEndBrackets")
-                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
-                    .SetCategory("SeparatorBetweenHeadAndBlock")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0092, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlockStartAndEndBrackets")
-                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
-                    .SetCategory("SeparatorBetweenHeadAndBlock")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0093, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionScriptBlockStartAndEndBrackets")
-                    .SetCategory("OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator")
-                    .SetCategory("SeparatorBetweenHeadAndBlock")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0094, new ExpressionEvaluator() {OptionKeywordForInstanceCreation = "->" }, null, null, null)
+                yield return new TestCaseData(Resources.Script0094, new ExpressionEvaluator() {OptionNewKeywordAliases = new[] { "->" } }, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionKeywordForInstanceCreation")
+                    .SetCategory(nameof(ExpressionEvaluator.OptionNewKeywordAliases))
                     .Returns(2);
 
-                yield return new TestCaseData(Resources.Script0095, new ExpressionEvaluator() {OptionKeywordForInstanceCreation = "create" }, null, null, null)
+                yield return new TestCaseData(Resources.Script0095, new ExpressionEvaluator() {OptionNewKeywordAliases = new[] { "new", "create" } }, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory("OptionKeywordForInstanceCreation")
-                    .Returns(2);
+                    .SetCategory(nameof(ExpressionEvaluator.OptionNewKeywordAliases))
+                    .Returns(12);
 
                 #endregion
 
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0095.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0095.txt
index c2c979e..e677e7b 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0095.txt
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0095.txt
@@ -4,4 +4,9 @@ myList = create List<int>()
 	2
 };
 
-return myList[0];
\ No newline at end of file
+myDict = new Dictionary<string, int>
+{
+	{"ten", 10 }
+};
+
+return myList[0] + myDict["ten"];
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index e3d8f89..6075758 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -110,7 +110,7 @@ protected virtual void RefreshEndOfExpressionDetection()
 
         protected virtual void RefreshInstanceCreationKeywordRegexPattern()
         {
-            instanceCreationKeywordRegexPattern = new Regex("^"+ OptionKeywordForInstanceCreation  + @"(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            instanceCreationKeywordRegexPattern = new Regex("^("+ string.Join("|", OptionNewKeywordAliases.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected RegexOptions CompiledRegexOptionAndIfNecessaryIgnoreCase => OptionCaseSensitiveEvaluationActive ? RegexOptions.Compiled : RegexOptions.IgnoreCase | RegexOptions.Compiled;
@@ -798,16 +798,17 @@ public bool OptionNewFunctionEvaluationActive
         /// </summary>
         public bool OptionNewKeywordEvaluationActive { get; set; } = true;
 
+        private string[] optionNewKeywordAliases = new[] { "new" };
         /// <summary>
-        /// To specify the keyword/operator that is used to create instance of object.
-        /// Default value : "new"
+        /// To replace or specify aliases of the new keyword for creation of object instances
+        /// Default value : {"new"}
         /// </summary>
-        public string OptionKeywordForInstanceCreation
+        public string[] OptionNewKeywordAliases
         {
-            get { return optionKeywordForInstanceCreation; }
+            get { return optionNewKeywordAliases; }
             set
             {
-                optionKeywordForInstanceCreation = value;
+                optionNewKeywordAliases = value;
                 RefreshInstanceCreationKeywordRegexPattern();
             }
         }
@@ -1562,7 +1563,6 @@ public T Evaluate<T>(string expression)
         }
 
         private IList<ParsingMethodDelegate> parsingMethods;
-        private string optionKeywordForInstanceCreation = "new";
 
         protected virtual IList<ParsingMethodDelegate> ParsingMethods => parsingMethods ?? (parsingMethods = new List<ParsingMethodDelegate>()
         {

From 5b195e560bee5bfbdc65d66b879ad54f3cc4b6bc Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 22 Jan 2021 14:43:38 +0100
Subject: [PATCH 25/48] RefreshInstanceCreationKeywordRegexPattern() on
 OptionInlineNamespacesEvaluationActive changed

---
 CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 6075758..775cdff 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -54,7 +54,6 @@ public partial class ExpressionEvaluator
         protected static readonly Regex initInNewBeginningRegex = new Regex(@"^(?>\s*){", RegexOptions.Compiled);
 
         // Depending on OptionInlineNamespacesEvaluationActive. Initialized in constructor
-        protected string InstanceCreationWithNewKeywordRegexPattern { get { return @"^new(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9"+ (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))"; } }
         protected Regex instanceCreationKeywordRegexPattern = new Regex(@"^new(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9\.]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", RegexOptions.Compiled);
         protected string CastRegexPattern { get { return @"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9"+ (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"\[\]<>]*[?]?)(?>\s*)\)"; } }
 
@@ -757,12 +756,21 @@ public string OptionNumberParsingThousandSeparator
         /// </summary>
         public bool OptionFluidPrefixingActive { get; set; } = true;
 
+        private bool optionInlineNamespacesEvaluationActive = true;
         /// <summary>
         /// if <c>true</c> allow the use of inline namespace (Can be slow, and is less secure).
         /// if <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available).
         /// Default value : true
         /// </summary>
-        public bool OptionInlineNamespacesEvaluationActive { get; set; } = true;
+        public bool OptionInlineNamespacesEvaluationActive
+        {
+            get { return optionInlineNamespacesEvaluationActive; }
+            set
+            {
+                optionInlineNamespacesEvaluationActive = value;
+                RefreshInstanceCreationKeywordRegexPattern();
+            }
+        }
 
         private Func<ExpressionEvaluator, List<string>, object> newMethodMem;
 

From 0949466173ecac6d02fe50685f053c14a16e2037 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 22 Jan 2021 14:50:37 +0100
Subject: [PATCH 26/48] Refactoring of cast CastRegex for better perfs at
 evaluation time.

---
 .../ExpressionEvaluator.cs                       | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 775cdff..a580eb3 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -54,8 +54,8 @@ public partial class ExpressionEvaluator
         protected static readonly Regex initInNewBeginningRegex = new Regex(@"^(?>\s*){", RegexOptions.Compiled);
 
         // Depending on OptionInlineNamespacesEvaluationActive. Initialized in constructor
-        protected Regex instanceCreationKeywordRegexPattern = new Regex(@"^new(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9\.]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", RegexOptions.Compiled);
-        protected string CastRegexPattern { get { return @"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9"+ (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"\[\]<>]*[?]?)(?>\s*)\)"; } }
+        protected Regex instanceCreationKeywordRegex = new Regex(@"^new(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9\.]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", RegexOptions.Compiled);
+        protected Regex castRegex = new Regex(@"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9\.\[\]<>]*[?]?)(?>\s*)\)", RegexOptions.Compiled);
 
         // To remove comments in scripts based on https://stackoverflow.com/questions/3524317/regex-to-strip-line-comments-from-c-sharp/3524689#3524689
         protected const string blockComments = @"/\*(.*?)\*/";
@@ -109,7 +109,12 @@ protected virtual void RefreshEndOfExpressionDetection()
 
         protected virtual void RefreshInstanceCreationKeywordRegexPattern()
         {
-            instanceCreationKeywordRegexPattern = new Regex("^("+ string.Join("|", OptionNewKeywordAliases.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            instanceCreationKeywordRegex = new Regex("^("+ string.Join("|", OptionNewKeywordAliases.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+        }
+
+        protected virtual void RefreshCastRegex()
+        {
+            castRegex = new Regex(@"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"\[\]<>]*[?]?)(?>\s*)\)", RegexOptions.Compiled);
         }
 
         protected RegexOptions CompiledRegexOptionAndIfNecessaryIgnoreCase => OptionCaseSensitiveEvaluationActive ? RegexOptions.Compiled : RegexOptions.IgnoreCase | RegexOptions.Compiled;
@@ -769,6 +774,7 @@ public bool OptionInlineNamespacesEvaluationActive
             {
                 optionInlineNamespacesEvaluationActive = value;
                 RefreshInstanceCreationKeywordRegexPattern();
+                RefreshCastRegex();
             }
         }
 
@@ -1800,7 +1806,7 @@ protected virtual void ExecuteTryList(List<List<string>> tryStatementsList, ref
 
         protected virtual bool EvaluateCast(string expression, Stack<object> stack, ref int i)
         {
-            Match castMatch = Regex.Match(expression.Substring(i), CastRegexPattern, optionCaseSensitiveEvaluationActive ? RegexOptions.None : RegexOptions.IgnoreCase);
+            Match castMatch = castRegex.Match(expression.Substring(i));
 
             if (castMatch.Success)
             {
@@ -1888,7 +1894,7 @@ protected virtual bool EvaluateInstanceCreationWithNewKeyword(string expression,
             if (!OptionNewKeywordEvaluationActive)
                 return false;
 
-            Match instanceCreationMatch = instanceCreationKeywordRegexPattern.Match(expression.Substring(i));
+            Match instanceCreationMatch = instanceCreationKeywordRegex.Match(expression.Substring(i));
 
             if (instanceCreationMatch.Success
                 && (stack.Count == 0

From 179ca99237d6ec3d73fe58ac34d9cae4a1f5769d Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 22 Jan 2021 14:53:21 +0100
Subject: [PATCH 27/48] wordTypeTokenBoundaryValidation compiled

---
 CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index a580eb3..1ecdc2d 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -71,7 +71,7 @@ public partial class ExpressionEvaluator
         protected Regex blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>[{])", RegexOptions.Compiled);
         protected Regex nextIsEndOfExpressionRegex = new Regex("^(;)", RegexOptions.Compiled);
         protected static readonly Regex wordTypeTokenDetectionRegex = new Regex(@"^(?>[\p{L}_0-9]+)$", RegexOptions.Compiled);
-        protected static readonly Regex wordTypeTokenBoundaryValidation = new Regex(@"[^\p{L}_0-9.]");
+        protected static readonly Regex wordTypeTokenBoundaryValidation = new Regex(@"[^\p{L}_0-9.]", RegexOptions.Compiled);
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex blockKeywordsWithoutHeadStatementBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>else|do|try|finally)(?![\p{L}_0-9])", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected static readonly Regex returnKeywordRegex = new Regex(@"^return((?>\s+)|(?=\())", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);

From 0a58dc3806572eff20cf14a9f20dd7de76163fda Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 27 Jan 2021 13:54:24 +0100
Subject: [PATCH 28/48] To suppress Warning due to Obsolete IconUrl Tag

---
 .../CodingSeb.ExpressionEvaluator.csproj                   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj b/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
index 0b6f999..e268024 100644
--- a/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
+++ b/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
@@ -17,8 +17,9 @@
     <TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
     <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
     <PackageIconUrl>https://github.com/codingseb/ExpressionEvaluator/blob/master/Icon.png?raw=true</PackageIconUrl>
+    <PackageIcon>Icon.png</PackageIcon>
     <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
-    <PackageReleaseNotes>* Better exception when expression is empty</PackageReleaseNotes>
+    <PackageReleaseNotes></PackageReleaseNotes>
     <PackageLicenseFile>LICENSE.md</PackageLicenseFile>
     <RepositoryUrl>https://github.com/codingseb/ExpressionEvaluator</RepositoryUrl>
   </PropertyGroup>
@@ -36,6 +37,10 @@
     <PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
   </ItemGroup>
   <ItemGroup>
+    <None Include="..\Icon.png">
+      <Pack>True</Pack>
+      <PackagePath></PackagePath>
+    </None>
     <None Include="..\LICENSE.md">
       <Pack>True</Pack>
       <PackagePath></PackagePath>

From be61c5f871d5ea5c52514b76e989949193045cea Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 27 Jan 2021 14:16:30 +0100
Subject: [PATCH 29/48] Basic indentation blocks for script keywords + tests
 (Python like syntax)

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs |  59 +++++++++
 .../Resources.Designer.cs                     |  83 +++++++++++-
 .../Resources.resx                            |  12 ++
 .../Resources/Script0096.txt                  |  11 ++
 .../Resources/Script0097.txt                  |  11 ++
 .../Resources/Script0098.txt                  |  11 ++
 .../Resources/Script0099.txt                  |  13 ++
 .../ExpressionEvaluator.cs                    | 125 +++++++++++++-----
 8 files changed, 294 insertions(+), 31 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0096.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0097.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0098.txt
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0099.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 20e34b8..0cf81c8 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1431,6 +1431,7 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory(nameof(ExpressionEvaluator.OptionScriptEndOfExpression))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression))
                     .Returns(8);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
@@ -1683,6 +1684,64 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory(nameof(ExpressionEvaluator.OptionNewKeywordAliases))
                     .Returns(12);
 
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator11 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation
+                };
+
+                yield return new TestCaseData(Resources.Script0096, flexibleScriptSyntaxEvaluator11, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
+                    .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Spaces))
+                    .Returns(24);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator12 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
+                    OptionScriptBlocksIndentation = ScriptBlocksIndentation.Tabulation
+                };
+
+                yield return new TestCaseData(Resources.Script0097, flexibleScriptSyntaxEvaluator12, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
+                    .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Tabulation))
+                    .Returns(24);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator13 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
+                    OptionScriptBlocksIndentationNumberOfSpaces = 2
+                };
+
+                yield return new TestCaseData(Resources.Script0098, flexibleScriptSyntaxEvaluator13, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
+                    .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Spaces))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksIndentationNumberOfSpaces))
+                    .Returns(24);
+
+                ExpressionEvaluator flexibleScriptSyntaxEvaluator14 = new ExpressionEvaluator()
+                {
+                    OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
+                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
+                    OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
+                    OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false,
+                };
+
+                yield return new TestCaseData(Resources.Script0099, flexibleScriptSyntaxEvaluator14, null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("FlexibleScriptSyntax")
+                    .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
+                    .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Spaces))
+                    .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptEndOfExpression))
+                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression))
+                    .SetCategory("PythonSyntax")
+                    .Returns(24);
+
                 #endregion
 
                 #region For Bug correction (no regression)
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index 0eb1e3a..473ff14 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1612,12 +1612,93 @@ public static string Script0094 {
         ///	2
         ///};
         ///
-        ///return myList[0];.
+        ///myDict = new Dictionary&lt;string, int&gt;
+        ///{
+        ///	{&quot;ten&quot;, 10 }
+        ///};
+        ///
+        ///return myList[0] + myDict[&quot;ten&quot;];.
         /// </summary>
         public static string Script0095 {
             get {
                 return ResourceManager.GetString("Script0095", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0096 indentation with 4 spaces*/
+        ///var myVar = 1;
+        ///var myVar2 = 2;
+        ///
+        ///while(myVar &lt; 20)
+        ///    myVar++;
+        ///    if (myVar == 7)
+        ///        myVar = 21;
+        ///        myVar2++;
+        ///
+        ///return myVar + myVar2;.
+        /// </summary>
+        public static string Script0096 {
+            get {
+                return ResourceManager.GetString("Script0096", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0097 indentation with tab*/
+        ///var myVar = 1;
+        ///var myVar2 = 2;
+        ///
+        ///while(myVar &lt; 20)
+        ///	myVar++;
+        ///	if (myVar == 7)
+        ///		myVar = 21;
+        ///		myVar2++;
+        ///
+        ///return myVar + myVar2;.
+        /// </summary>
+        public static string Script0097 {
+            get {
+                return ResourceManager.GetString("Script0097", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0098 indentation with 2 spaces*/
+        ///var myVar = 1;
+        ///var myVar2 = 2;
+        ///
+        ///while(myVar &lt; 20)
+        ///  myVar++;
+        ///  if (myVar == 7)
+        ///    myVar = 21;
+        ///    myVar2++;
+        ///
+        ///return myVar + myVar2;.
+        /// </summary>
+        public static string Script0098 {
+            get {
+                return ResourceManager.GetString("Script0098", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to /* Script0099 python like syntax*/
+        ///myVar = 1
+        ///myVar2 = 2
+        ///
+        ///while myVar &lt; 20:
+        ///    myVar++
+        ///    if myVar == 7:
+        ///        myVar = 21
+        ///        myVar2++
+        ///
+        ///return myVar + myVar2.
+        /// </summary>
+        public static string Script0099 {
+            get {
+                return ResourceManager.GetString("Script0099", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index 501bf9e..cf65430 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -403,4 +403,16 @@
   <data name="Script0095" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0095.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0096" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0096.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0097" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0097.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0098" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0098.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+  <data name="Script0099" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0099.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0096.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0096.txt
new file mode 100644
index 0000000..c273f87
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0096.txt
@@ -0,0 +1,11 @@
+﻿/* Script0096 indentation with 4 spaces*/
+var myVar = 1;
+var myVar2 = 2;
+
+while(myVar < 20)
+    myVar++;
+    if (myVar == 7)
+        myVar = 21;
+        myVar2++;
+
+return myVar + myVar2;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0097.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0097.txt
new file mode 100644
index 0000000..43a2889
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0097.txt
@@ -0,0 +1,11 @@
+﻿/* Script0097 indentation with tab*/
+var myVar = 1;
+var myVar2 = 2;
+
+while(myVar < 20)
+	myVar++;
+	if (myVar == 7)
+		myVar = 21;
+		myVar2++;
+
+return myVar + myVar2;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0098.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0098.txt
new file mode 100644
index 0000000..78dea19
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0098.txt
@@ -0,0 +1,11 @@
+﻿/* Script0098 indentation with 2 spaces*/
+var myVar = 1;
+var myVar2 = 2;
+
+while(myVar < 20)
+  myVar++;
+  if (myVar == 7)
+    myVar = 21;
+    myVar2++;
+
+return myVar + myVar2;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0099.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0099.txt
new file mode 100644
index 0000000..5456563
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0099.txt
@@ -0,0 +1,13 @@
+﻿/* Script0099 python like syntax*/
+myVar = 1
+myVar2 = 2
+
+while myVar < 20:
+
+    myVar++
+
+    if myVar == 7:
+        myVar = 21
+        myVar2++
+
+return myVar + myVar2
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index de5322d..4b528d5 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -70,6 +70,8 @@ public partial class ExpressionEvaluator
         protected Regex blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)(?<startBracket>\()", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         protected Regex blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>:)", RegexOptions.Compiled);
         protected Regex blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>[{])", RegexOptions.Compiled);
+        protected Regex blockIndentationRegex = new Regex(@"^([\r\n]*(([ ]{4})+.*)([\r\n]|$)+)+", RegexOptions.Compiled);
+        protected Regex blockIndentationLevelTrimRegex = new Regex("^[ ]{4}", RegexOptions.Compiled | RegexOptions.Multiline);
         protected Regex nextIsEndOfExpressionRegex = new Regex("^(;)", RegexOptions.Compiled);
         protected static readonly Regex wordTypeTokenDetectionRegex = new Regex(@"^(?>[\p{L}_0-9]+)$", RegexOptions.Compiled);
         protected static readonly Regex wordTypeTokenBoundaryValidation = new Regex(@"[^\p{L}_0-9.]", RegexOptions.Compiled);
@@ -95,14 +97,19 @@ protected virtual void RefreshBlocksKeywordDetection()
             blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
-        protected virtual void RefreshBlockDetection()
+        protected virtual void RefreshBlockStartDetection()
         {
             blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionScriptBlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
-        /// <summary>
-        /// Rebuild some Regex to detect end of expression
-        /// </summary>
+        protected virtual void RefreshIndentedBlockDetection()
+        {
+            string indentRegexPattern = OptionScriptBlocksIndentation == ScriptBlocksIndentation.Tabulation ? @"\t" : "[ ]{" + OptionScriptBlocksIndentationNumberOfSpaces + "}";
+
+            blockIndentationRegex = new Regex(@"^([\r\n]*((" + indentRegexPattern + @")+.*)([\r\n]|$)+)+", RegexOptions.Compiled);
+            blockIndentationLevelTrimRegex = new Regex("^" + indentRegexPattern, RegexOptions.Compiled | RegexOptions.Multiline);
+        }
+
         protected virtual void RefreshEndOfExpressionDetection()
         {
             nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", CompiledRegexOptionAndIfNecessaryIgnoreCase);
@@ -634,7 +641,7 @@ public bool OptionCaseSensitiveEvaluationActive
                 simpleDoubleMathFuncsDictionary = new Dictionary<string, Func<double, double>>(simpleDoubleMathFuncsDictionary, StringComparerForCasing);
                 doubleDoubleMathFuncsDictionary = new Dictionary<string, Func<double, double, double>>(doubleDoubleMathFuncsDictionary, StringComparerForCasing);
                 complexStandardFuncsDictionary = new Dictionary<string, Func<ExpressionEvaluator, List<string>, object>>(complexStandardFuncsDictionary, StringComparerForCasing);
-                RefreshBlockDetection();
+                RefreshBlockStartDetection();
                 RefreshBlocksKeywordDetection();
                 RefreshEndOfExpressionDetection();
                 RefreshInstanceCreationKeywordRegexPattern();
@@ -1004,7 +1011,7 @@ public string OptionScriptBlockStartBracket
             {
                 optionScriptBlockStartBracket = value;
                 isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
-                RefreshBlockDetection();
+                RefreshBlockStartDetection();
             }
         }
 
@@ -1030,6 +1037,38 @@ public string OptionScriptBlockEndBracket
         /// </summary>
         public SyntaxForScriptBlocksIdentifier OptionScriptSyntaxForBlocksIdentifier { get; set; }
 
+        private ScriptBlocksIndentation optionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces;
+        /// <summary>
+        /// Specify the kind of indentation to use when <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c>.
+        /// When set to Spaces ensure to set also <c>OptionScriptBlocksIndentationNumberOfSpaces</c>
+        /// Default value : <c>ScriptBlocksIndentation.Spaces</c>
+        /// </summary>
+        public ScriptBlocksIndentation OptionScriptBlocksIndentation
+        {
+            get { return optionScriptBlocksIndentation; }
+            set
+            {
+                optionScriptBlocksIndentation = value;
+                RefreshIndentedBlockDetection();
+            }
+        }
+
+        private int optionScriptBlocksIndentationNumberOfSpaces = 4;
+        /// <summary>
+        /// set the number of spaces to use as an indentation when <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c>
+        /// and <c>OptionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces</c>
+        /// Default value : <c>4</c>
+        /// </summary>
+        public int OptionScriptBlocksIndentationNumberOfSpaces
+        {
+            get { return optionScriptBlocksIndentationNumberOfSpaces; }
+            set
+            {
+                optionScriptBlocksIndentationNumberOfSpaces = value;
+                RefreshIndentedBlockDetection();
+            }
+        }
+
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)
         /// If <c>false</c> Allow to access only to public members.
@@ -1295,43 +1334,63 @@ void ExecuteBlocksStacks()
                         i++;
                     }
 
-                    Match blockBeginningMatch = blockBeginningRegex.Match(script.Substring(i));
-
                     string subScript = string.Empty;
 
-                    if (blockBeginningMatch.Success &&
-                        (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, i + blockBeginningMatch.Groups["startBracket"].Index - 1, i + blockBeginningMatch.Length)))
+                    if (OptionScriptSyntaxForBlocksIdentifier == SyntaxForScriptBlocksIdentifier.Indentation)
                     {
-                        i += blockBeginningMatch.Length;
-
-                        subScript = GetScriptBetweenBlockBrackets(script, ref i);
+                        Match blockIndentationMatch = blockIndentationRegex.Match(script.Substring(i));
+                        if (blockIndentationMatch.Success)
+                        {
+                            subScript = blockIndentationLevelTrimRegex.Replace(blockIndentationMatch.Value, string.Empty);
 
-                        i++;
+                            i += blockIndentationMatch.Length;
+                        }
+                        else
+                        {
+                            throw new ExpressionEvaluatorSyntaxErrorException($"No indented block found after \"{keyword}\" keyword");
+                        }
                     }
                     else
                     {
-                        bool continueExpressionParsing = true;
-                        startOfExpression = i;
+                        Match blockBeginningMatch = blockBeginningRegex.Match(script.Substring(i));
 
-                        while (i < script.Length && continueExpressionParsing)
+                        if (blockBeginningMatch.Success &&
+                            (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, i + blockBeginningMatch.Groups["startBracket"].Index - 1, i + blockBeginningMatch.Length)))
                         {
-                            if (TryParseStringAndParenthesesAndCurlyBrackets(script, ref i)) { }
-                            else if (script.Length - i >= 3 && OptionScriptEndOfExpression.Any( o =>  o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
-                            {
-                                i += 2;
-                            }
-                            else if (nextIsEndOfExpressionRegex.IsMatch(script.Substring(i)))
-                            {
-                                subScript = script.Substring(startOfExpression, i + 1 - startOfExpression);
-                                continueExpressionParsing = false;
-                                i += OptionScriptEndOfExpression.Length - 1;
-                            }
+                            i += blockBeginningMatch.Length;
+
+                            subScript = GetScriptBetweenBlockBrackets(script, ref i);
 
                             i++;
                         }
+                        else
+                        {
+                            if (OptionScriptSyntaxForBlocksIdentifier == SyntaxForScriptBlocksIdentifier.MandatoryBracketsForStartAndEnd)
+                                throw new ExpressionEvaluatorSyntaxErrorException($"$A block of code must be defined between \"{OptionScriptBlockStartBracket}\" and \"{OptionScriptBlockEndBracket}\" after a [{keyword}] keyword");
+
+                            bool continueExpressionParsing = true;
+                            startOfExpression = i;
+
+                            while (i < script.Length && continueExpressionParsing)
+                            {
+                                if (TryParseStringAndParenthesesAndCurlyBrackets(script, ref i)) { }
+                                else if (script.Length - i >= 3 && OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
+                                {
+                                    i += 2;
+                                }
+                                else if (nextIsEndOfExpressionRegex.IsMatch(script.Substring(i)))
+                                {
+                                    subScript = script.Substring(startOfExpression, i + 1 - startOfExpression);
+                                    continueExpressionParsing = false;
+                                    i += OptionScriptEndOfExpression.Length - 1;
+                                }
 
-                        if (subScript.Trim().Equals(string.Empty))
-                            throw new ExpressionEvaluatorSyntaxErrorException($"No instruction after [{keyword}] statement.");
+                                i++;
+                            }
+
+                            if (subScript.Trim().Equals(string.Empty))
+                                throw new ExpressionEvaluatorSyntaxErrorException($"No instruction after [{keyword}] statement.");
+                        }
                     }
 
                     if (keyword.Equals("elseif", StringComparisonForCasing))
@@ -4159,6 +4218,12 @@ public enum SyntaxForScriptBlocksIdentifier
         Indentation
     }
 
+    public enum ScriptBlocksIndentation
+    {
+        Tabulation,
+        Spaces
+    }
+
     #endregion
 
     #region ExpressionEvaluator linked public classes (specific Exceptions, EventArgs and Operators)

From 2270895d606213938bc606ff1398f2f71fabbaca Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 27 Jan 2021 15:45:06 +0100
Subject: [PATCH 30/48] Some formating of xml comments for more readable doc in
 code.

---
 .../ExpressionEvaluator.cs                    | 219 +++++++++---------
 1 file changed, 111 insertions(+), 108 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 4b528d5..e167ce1 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -90,7 +90,7 @@ protected virtual void RefreshBlocksKeywordDetection()
             if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any)
                 optional = "?";
 
-            if(OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
+            if (OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
                 startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
 
             blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, CompiledRegexOptionAndIfNecessaryIgnoreCase);
@@ -117,7 +117,7 @@ protected virtual void RefreshEndOfExpressionDetection()
 
         protected virtual void RefreshInstanceCreationKeywordRegexPattern()
         {
-            instanceCreationKeywordRegex = new Regex("^("+ string.Join("|", OptionNewKeywordAliases.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            instanceCreationKeywordRegex = new Regex("^(" + string.Join("|", OptionNewKeywordAliases.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshCastRegex()
@@ -525,7 +525,7 @@ protected static object IndexingOperatorFunc(dynamic left, dynamic right)
 
         /// <summary>
         /// Specify for each possible imbricable type of opening brackets the corresponding closing bracket
-        /// Default value : { "(" : ")", "{" : "}", "[", "]" }
+        /// <para>Default value : <c>{ "(" : ")", "{" : "}", "[", "]" }</c></para>
         /// </summary>
         public IDictionary<string, string> ImbricableBracketsPairing { get; } = new Dictionary<string, string>()
         {
@@ -544,10 +544,10 @@ protected static object IndexingOperatorFunc(dynamic left, dynamic right)
         #region Caching
 
         /// <summary>
-        /// if set to <c>true</c> use a cache for types that were resolved to resolve faster next time.
-        /// if set to <c>false</c> the cache of types resolution is not use for this instance of ExpressionEvaluator.
-        /// Default : false
-        /// the cache is the static Dictionary TypesResolutionCaching (so it is shared by all instances of ExpressionEvaluator that have CacheTypesResolutions enabled)
+        /// If set to <c>true</c> use a cache for types that were resolved to resolve faster next time<para/>
+        /// If set to <c>false</c> the cache of types resolution is not use for this instance of ExpressionEvaluator
+        /// <para>Default value : <c>false</c></para>
+        /// The cache is the static Dictionary TypesResolutionCaching (so it is shared by all instances of ExpressionEvaluator that have CacheTypesResolutions enabled)
         /// </summary>
         public bool CacheTypesResolutions { get; set; }
 
@@ -624,9 +624,9 @@ public virtual IList<Assembly> Assemblies
         private bool optionCaseSensitiveEvaluationActive = true;
 
         /// <summary>
-        /// If <c>true</c> all evaluation are case sensitives.
+        /// If <c>true</c> all evaluation are case sensitives<para/>
         /// If <c>false</c> evaluations are case insensitive.
-        /// Default value = true
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionCaseSensitiveEvaluationActive
         {
@@ -659,9 +659,9 @@ protected StringComparer StringComparerForCasing
         }
 
         /// <summary>
-        /// If <c>true</c> all numbers without decimal and suffixes evaluations will be done as double
+        /// If <c>true</c> all numbers without decimal and suffixes evaluations will be done as double<para/>
         /// If <c>false</c> Integers values without decimal and suffixes will be evaluate as int as in C# (Warning some operation can round values)
-        /// Default value = false
+        /// <para>Default value : <c>false</c></para>
         /// </summary>
         public bool OptionForceIntegerNumbersEvaluationsAsDoubleByDefault { get; set; }
 
@@ -671,7 +671,7 @@ protected StringComparer StringComparerForCasing
         /// The culture used to evaluate numbers
         /// Synchronized with OptionNumberParsingDecimalSeparator and OptionNumberParsingThousandSeparator.
         /// So always set a full CultureInfo object and do not change CultureInfoForNumberParsing.NumberFormat.NumberDecimalSeparator and CultureInfoForNumberParsing.NumberFormat.NumberGroupSeparator properties directly.
-        /// Warning if using comma in separators change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts
+        /// <para>Warning if using comma in separators change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts</para>
         /// </summary>
         public CultureInfo CultureInfoForNumberParsing
         {
@@ -693,8 +693,8 @@ public CultureInfo CultureInfoForNumberParsing
 
         /// <summary>
         /// Allow to change the decimal separator of numbers when parsing expressions.
-        /// Default value "."
-        /// Warning if using comma change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts.
+        /// <para>Default value : <c>"."</c></para>
+        /// Warning if using comma change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts.<para/>
         /// Modify CultureInfoForNumberParsing.
         /// </summary>
         public string OptionNumberParsingDecimalSeparator
@@ -719,8 +719,8 @@ public string OptionNumberParsingDecimalSeparator
 
         /// <summary>
         /// Allow to change the thousand separator of numbers when parsing expressions.
-        /// Default value string.Empty
-        /// Warning if using comma change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts.
+        /// <para>Default value : <c>string.Empty</c></para>
+        /// Warning if using comma change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts.<para/>
         /// Modify CultureInfoForNumberParsing.
         /// </summary>
         public string OptionNumberParsingThousandSeparator
@@ -743,37 +743,37 @@ public string OptionNumberParsingThousandSeparator
 
         /// <summary>
         /// Allow to change the separator of functions arguments.
-        /// Default value : ","
+        /// <para>Default value : <c>","</c></para>
         /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
         /// </summary>
         public string OptionFunctionArgumentsSeparator { get; set; } = ",";
 
         /// <summary>
         /// Allow to change the separator of Object and collections Initialization between { and } after the keyword new.
-        /// Default value : ","
+        /// <para>Default value : <c>","</c></para>
         /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
         /// </summary>
         public string OptionInitializersSeparator { get; set; } = ",";
 
         /// <summary>
         /// The separator that separate each expression in block keyword's head
-        /// Default value : ";"
-        /// Example : for(int i = 0; i < 10; i++)
+        /// <para>Default value : <c>";"</c></para>
+        /// <example>Example : <code>for(int i = 0; i &lt; 10; i++)</code></example>
         /// </summary>
         public string OptionScriptBlockKeywordsHeadSubExpressionsSeparator { get; set; } = ";";
 
         /// <summary>
-        /// if <c>true</c> allow to add the prefix Fluid or Fluent before void methods names to return back the instance on which the method is call.
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow to add the prefix Fluid or Fluent before void methods names to return back the instance on which the method is call<para/>
+        /// If <c>false</c> unactive this functionality
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionFluidPrefixingActive { get; set; } = true;
 
         private bool optionInlineNamespacesEvaluationActive = true;
         /// <summary>
-        /// if <c>true</c> allow the use of inline namespace (Can be slow, and is less secure).
-        /// if <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available).
-        /// Default value : true
+        /// If <c>true</c> allow the use of inline namespace (Can be slow, and is less secure)<para/>
+        /// If <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available)
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionInlineNamespacesEvaluationActive
         {
@@ -789,9 +789,9 @@ public bool OptionInlineNamespacesEvaluationActive
         private Func<ExpressionEvaluator, List<string>, object> newMethodMem;
 
         /// <summary>
-        /// if <c>true</c> allow to create instance of object with the Default function new(ClassNam,...).
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow to create instance of object with the Default function new(ClassNam,...)<para/>
+        /// If <c>false</c> unactive this functionality.
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionNewFunctionEvaluationActive
         {
@@ -814,16 +814,16 @@ public bool OptionNewFunctionEvaluationActive
         }
 
         /// <summary>
-        /// if <c>true</c> allow to create instance of object with the C# syntax new ClassName(...).
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow to create instance of object with the C# syntax new ClassName(...)<para/>
+        /// If <c>false</c> unactive this functionality.
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionNewKeywordEvaluationActive { get; set; } = true;
 
         private string[] optionNewKeywordAliases = new[] { "new" };
         /// <summary>
         /// To replace or specify aliases of the new keyword for creation of object instances
-        /// Default value : {"new"}
+        /// <para>Default value : <c>{"new"}</c></para>
         /// </summary>
         public string[] OptionNewKeywordAliases
         {
@@ -836,101 +836,101 @@ public string[] OptionNewKeywordAliases
         }
 
         /// <summary>
-        /// if <c>true</c> allow to call static methods on classes.
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow to call static methods on classes.<para/>
+        /// If <c>false</c> unactive this functionality.
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionStaticMethodsCallActive { get; set; } = true;
 
         /// <summary>
-        /// if <c>true</c> allow to get static properties on classes
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow to get static properties on classes<para/>
+        /// If <c>false</c> unactive this functionality
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionStaticPropertiesGetActive { get; set; } = true;
 
         /// <summary>
-        /// if <c>true</c> allow to call instance methods on objects.
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow to call instance methods on objects<para/>
+        /// If <c>false</c> unactive this functionality
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionInstanceMethodsCallActive { get; set; } = true;
 
         /// <summary>
-        /// if <c>true</c> allow to get instance properties on objects
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow to get instance properties on objects<para/>
+        /// If <c>false</c> unactive this functionality.
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionInstancePropertiesGetActive { get; set; } = true;
 
         /// <summary>
-        /// if <c>true</c> allow to get object at index or key like IndexedObject[indexOrKey]
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow to get object at index or key like IndexedObject[indexOrKey]<para/>
+        /// If <c>false</c> unactive this functionality.
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionIndexingActive { get; set; } = true;
 
         /// <summary>
-        /// if <c>true</c> allow string interpretation with ""
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow string interpretation with ""<para/>
+        /// If <c>false</c> unactive this functionality
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionStringEvaluationActive { get; set; } = true;
 
         /// <summary>
-        /// if <c>true</c> allow char interpretation with ''
-        /// if <c>false</c> unactive this functionality.
-        /// Default value : true
+        /// If <c>true</c> allow char interpretation with ''<para/>
+        /// If <c>false</c> unactive this functionality
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionCharEvaluationActive { get; set; } = true;
 
         /// <summary>
-        /// If <c>true</c> Evaluate function is callables in an expression. If <c>false</c> Evaluate is not callable.
-        /// Default value : true
-        /// if set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
+        /// If <c>true</c> Evaluate function is callables in an expression. If <c>false</c> Evaluate is not callable<para/>
+        /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionEvaluateFunctionActive { get; set; } = true;
 
         /// <summary>
-        /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ??=, ++ or --)
+        /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
         /// If <c>false</c> unactive this functionality
-        /// Default value : true
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionVariableAssignationActive { get; set; } = true;
 
         /// <summary>
-        /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ??=, ++ or --)
+        /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
         /// If <c>false</c> unactive this functionality
-        /// Default value : true
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionPropertyOrFieldSetActive { get; set; } = true;
 
         /// <summary>
-        /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, ??=, ++ or --)
+        /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
         /// If <c>false</c> unactive this functionality
-        /// Default value : true
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionIndexingAssignationActive { get; set; } = true;
 
         /// <summary>
         /// If <c>true</c> ScriptEvaluate function is callables in an expression. If <c>false</c> Evaluate is not callable.
-        /// Default value : true
-        /// if set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
+        /// <para>Default value : <c>true</c></para>
+        /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
         /// </summary>
         public bool OptionScriptEvaluateFunctionActive { get; set; } = true;
 
         /// <summary>
-        /// If <c>ReturnAutomaticallyLastEvaluatedExpression</c> ScriptEvaluate return automatically the last evaluated expression if no return keyword is met.
-        /// If <c>ReturnNull</c> return null if no return keyword is met.
-        /// If <c>ThrowSyntaxException</c> a exception is throw if no return keyword is met.
-        /// Default value : ReturnAutomaticallyLastEvaluatedExpression;
+        /// If <c>ReturnAutomaticallyLastEvaluatedExpression</c> ScriptEvaluate return automatically the last evaluated expression if no return keyword is met<para/>
+        /// If <c>ReturnNull</c> return null if no return keyword is met<para/>
+        /// If <c>ThrowSyntaxException</c> a exception is throw if no return keyword is met<para/>
+        /// <para>Default value : <c>ReturnAutomaticallyLastEvaluatedExpression;</c></para>
         /// </summary>
         public OptionOnNoReturnKeywordFoundInScriptAction OptionOnNoReturnKeywordFoundInScriptAction { get; set; }
 
         private string[] optionScriptEndOfExpression = new[] { ";" };
         /// <summary>
-        /// An array of string that are used to separate expressions in script.
-        /// Default value : {";"}
+        /// An array of string that are used to separate expressions in script
+        /// <para>Default value : <c>{";"}</c></para>
         /// </summary>
         public string[] OptionScriptEndOfExpression
         {
@@ -944,22 +944,22 @@ public string[] OptionScriptEndOfExpression
 
         /// <summary>
         /// Specify to skip the evaluation of an empty expression in scripts otherwise it will throw an exception.
-        /// Default value : true;
         /// For example when two semicolon ;; are present or when there are empty line with OptionScriptEndOfExpression set to end of line characters { "\r\n", "\r", "\n" }
+        /// <para>Default value : <c>true;</c></para>
         /// </summary>
         public bool OptionScriptSkipEmptyExpressions { get; set; } = true;
 
         /// <summary>
-        /// If <c>true</c> ScriptEvaluate need to have a semicolon [;] or the specified text in OptionScriptEndOfExpression after each expression.
+        /// If <c>true</c> ScriptEvaluate need to have a semicolon [;] or the specified text in OptionScriptEndOfExpression after each expression.<para/>
         /// If <c>false</c> Allow to omit the OptionScriptEndOfExpression for the last expression of the script.
-        /// Default : true
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression { get; set; } = true;
 
         private string optionScriptBlocksKeywordsHeadStatementsStartBracket = "(";
         /// <summary>
         /// To specify the character or string that begin the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// Default value : <c>"("</c>
+        /// <para>Default value : <c>"("</c></para>
         /// </summary>
         public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
         {
@@ -973,20 +973,20 @@ public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
 
         /// <summary>
         /// To specify the character or string that end the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// Default value : <c>")"</c>
+        /// <para>Default value : <c>")"</c></para>
         /// </summary>
         public string OptionScriptBlocksKeywordsHeadExpressionEndBracket { get; set; } = ")";
 
         /// <summary>
         /// To specify the character or string that separate the head statements and the block statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// Default value : <c>":"</c>
+        /// <para>Default value : <c>":"</c></para>
         /// </summary>
         public string OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator { get; set; } = ":";
 
         private SyntaxForHeadStatementInBlocksKeywords optionScriptSyntaxForHeadStatementInBlocksKeywords;
         /// <summary>
         /// Specify how to detect the separation between head expression and the block of code is made in script block keyword (if, else if, for, foreach while, do.. while)
-        /// Default value : <c>HeadBrackets</c>
+        /// <para>Default value : <c>HeadBrackets</c></para>
         /// </summary>
         public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatementInBlocksKeywords
         {
@@ -1002,7 +1002,7 @@ public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatement
         private string optionScriptBlockStartBracket = "{";
         /// <summary>
         /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
-        /// Default value : <c>"{"</c>
+        /// <para>Default value : <c>"{"</c></para>
         /// </summary>
         public string OptionScriptBlockStartBracket
         {
@@ -1019,7 +1019,7 @@ public string OptionScriptBlockStartBracket
         private string optionScriptBlockEndBracket = "}";
         /// <summary>
         /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
-        /// Default value : <c>"}"</c>
+        /// <para>Default value : <c>"}"</c></para>
         /// </summary>
         public string OptionScriptBlockEndBracket
         {
@@ -1033,15 +1033,16 @@ public string OptionScriptBlockEndBracket
 
         /// <summary>
         /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
-        /// Default value : OptionalBracketsForStartAndEndWhenSingleStatement
+        /// <para>Default value : <c>OptionalBracketsForStartAndEndWhenSingleStatement</c></para>
         /// </summary>
         public SyntaxForScriptBlocksIdentifier OptionScriptSyntaxForBlocksIdentifier { get; set; }
 
         private ScriptBlocksIndentation optionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces;
         /// <summary>
-        /// Specify the kind of indentation to use when <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c>.
-        /// When set to Spaces ensure to set also <c>OptionScriptBlocksIndentationNumberOfSpaces</c>
-        /// Default value : <c>ScriptBlocksIndentation.Spaces</c>
+        /// Specify the kind of indentation to use when :<para/>
+        /// <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c>
+        /// <para>When Set to Spaces ensure to set also <c>OptionScriptBlocksIndentationNumberOfSpaces</c></para>
+        /// <para>Default value : <c>ScriptBlocksIndentation.Spaces</c></para>
         /// </summary>
         public ScriptBlocksIndentation OptionScriptBlocksIndentation
         {
@@ -1055,9 +1056,11 @@ public ScriptBlocksIndentation OptionScriptBlocksIndentation
 
         private int optionScriptBlocksIndentationNumberOfSpaces = 4;
         /// <summary>
-        /// set the number of spaces to use as an indentation when <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c>
-        /// and <c>OptionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces</c>
-        /// Default value : <c>4</c>
+        /// Set the number of spaces to use as an indentation when : <para/>
+        /// <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c><para/>
+        /// and<para/>
+        /// <c>OptionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces</c>
+        /// <para>Default value : <c>4</c></para>
         /// </summary>
         public int OptionScriptBlocksIndentationNumberOfSpaces
         {
@@ -1070,17 +1073,17 @@ public int OptionScriptBlocksIndentationNumberOfSpaces
         }
 
         /// <summary>
-        /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)
+        /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)<para/>
         /// If <c>false</c> Allow to access only to public members.
-        /// Default : false
+        /// <para>Default value : <c>false</c></para>
         /// Warning : This clearly break the encapsulation principle use this only if you know what you do.
         /// </summary>
         public bool OptionAllowNonPublicMembersAccess { get; set; }
 
         /// <summary>
-        /// If <c>true</c> On unsuccessful call to an extension method, all defined overloads of that method are detected to resolve whether method is defined and called with wrong arguments or method is not defined.
+        /// If <c>true</c> On unsuccessful call to an extension method, all defined overloads of that method are detected to resolve whether method is defined and called with wrong arguments or method is not defined.<para/>
         /// If <c>false</c> Unsucessful call to an extension method will always result in "Method {name} is not defined on type {type}"
-        /// Default : true
+        /// <para>Default value : <c>true</c></para>
         /// </summary>
         public bool OptionDetectExtensionMethodsOverloadsOnExtensionMethodNotFound { get; set; } = true;
 
@@ -1320,7 +1323,7 @@ void ExecuteBlocksStacks()
                         {
                             keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator, OptionScriptBlocksKeywordsHeadStatementsStartBracket, OptionScriptBlocksKeywordsHeadExpressionEndBracket);
 
-                            if(OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.HeadBrackets)
+                            if (OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.HeadBrackets)
                             {
                                 Match blockKeywordsHeadAndBodySeparatorMatch = blockKeywordsHeadAndBodySeparatorRegex.Match(script.Substring(i + 1));
 
@@ -1612,7 +1615,7 @@ void forAction(int index)
             }
 
             if (!script.Substring(startOfExpression).Trim().Equals(string.Empty) && !isReturn && !isBreak && !isContinue && OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression)
-                throw new ExpressionEvaluatorSyntaxErrorException($"An end of expression [{string.Join(",", OptionScriptEndOfExpression.Select(s=> "\"" + Regex.Escape(s) + "\""))}] token is missing.");
+                throw new ExpressionEvaluatorSyntaxErrorException($"An end of expression [{string.Join(",", OptionScriptEndOfExpression.Select(s => "\"" + Regex.Escape(s) + "\""))}] token is missing.");
 
             ExecuteBlocksStacks();
 
@@ -1770,7 +1773,7 @@ protected virtual bool TryParseStringAndParenthesesAndCurlyBrackets(string scrip
             }
             else if (script.Substring(index).StartsWith(OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, index - 1, index + OptionScriptBlockStartBracket.Length)))
             {
-                index+=OptionScriptBlockStartBracket.Length;
+                index += OptionScriptBlockStartBracket.Length;
                 GetScriptBetweenBlockBrackets(script, ref index);
             }
             else
@@ -2276,14 +2279,14 @@ protected virtual bool EvaluateVarOrFunc(string expression, Stack<object> stack,
                                                 if (OptionDetectExtensionMethodsOverloadsOnExtensionMethodNotFound)
                                                 {
                                                     IEnumerable<MethodInfo> query = from type in StaticTypesForExtensionsMethods
-                                                        where
-                                                              !type.IsGenericType &&
-                                                              type.IsSealed &&
-                                                              !type.IsNested
-                                                        from method in type.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
-                                                        where method.IsDefined(typeof(ExtensionAttribute), false)
-                                                        where method.GetParameters()[0].ParameterType == objType // static extMethod(this outType, ...)
-                                                        select method;
+                                                                                    where
+                                                                                          !type.IsGenericType &&
+                                                                                          type.IsSealed &&
+                                                                                          !type.IsNested
+                                                                                    from method in type.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
+                                                                                    where method.IsDefined(typeof(ExtensionAttribute), false)
+                                                                                    where method.GetParameters()[0].ParameterType == objType // static extMethod(this outType, ...)
+                                                                                    select method;
 
                                                     if (query.Any())
                                                     {
@@ -3672,7 +3675,7 @@ protected virtual string GetScriptBetweenBlockBrackets(string parentScript, ref
                     }
                     else
                     {
-                        currentScript += parentScript.Substring(index,1);
+                        currentScript += parentScript.Substring(index, 1);
                     }
                 }
             }
@@ -3739,7 +3742,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
 
                     if (openingBracket != null)
                     {
-                        i+= openingBracket.Length;
+                        i += openingBracket.Length;
                         string closingBrackets = ImbricableBracketsPairing[openingBracket];
                         currentExpression += openingBracket + GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, false, null, openingBracket, closingBrackets).SingleOrDefault() + closingBrackets;
                         continue;
@@ -3754,7 +3757,7 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                     }
                     else
                     {
-                        currentExpression += expression.Substring(i,1);
+                        currentExpression += expression.Substring(i, 1);
                     }
                 }
             }
@@ -4469,7 +4472,7 @@ public object Value
         }
 
         /// <summary>
-        /// if <c>true</c> the variable is affected, if <c>false</c> it means that the variable does not exist.
+        /// If <c>true</c> the variable is affected, if <c>false</c> it means that the variable does not exist.
         /// </summary>
         public bool HasValue { get; set; }
 
@@ -4591,7 +4594,7 @@ public object Value
         }
 
         /// <summary>
-        /// if <c>true</c> the function evaluation has been done, if <c>false</c> it means that the function does not exist.
+        /// If <c>true</c> the function evaluation has been done, if <c>false</c> it means that the function does not exist.
         /// </summary>
         public bool FunctionReturnedValue { get; set; }
 
@@ -4641,4 +4644,4 @@ public FunctionPreEvaluationEventArg(string name, Func<string, object> evaluateF
     }
 
     #endregion
-}
+}
\ No newline at end of file

From ac631f4f733d6171d5ea2774432edbb7c76ce01e Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 3 Feb 2021 07:15:04 +0100
Subject: [PATCH 31/48] small exception text correction

---
 CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index e167ce1..cc92b0a 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -1499,7 +1499,7 @@ void ExecuteBlocksStacks()
                             }
                             else
                             {
-                                throw new ExpressionEvaluatorSyntaxErrorException("No [while] keyword afte the [do] keyword and block");
+                                throw new ExpressionEvaluatorSyntaxErrorException("No [while] keyword after the [do] keyword and block");
                             }
                         }
                         else if (keyword.Equals("while", StringComparisonForCasing))

From d819c4a2a7a74a2adfcea12c527d7cb10910563e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien?= <sebgeiser@gmail.com>
Date: Tue, 20 Apr 2021 20:12:41 +0200
Subject: [PATCH 32/48] In progress

---
 .../ExpressionEvaluator.cs                    | 701 ++++++++++--------
 1 file changed, 372 insertions(+), 329 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 6450d42..0fb3340 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -88,24 +88,24 @@ protected virtual void RefreshBlocksKeywordDetection()
             string optional = string.Empty;
             string startBracketDetection = string.Empty;
 
-            if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any)
+             if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any)
                 optional = "?";
 
-            if (OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
+            if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
                 startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
 
             blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, CompiledRegexOptionAndIfNecessaryIgnoreCase);
-            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionsSyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshBlockStartDetection()
         {
-            blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionScriptBlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionsSyntaxRules.OptionScriptBlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshIndentedBlockDetection()
         {
-            string indentRegexPattern = OptionScriptBlocksIndentation == ScriptBlocksIndentation.Tabulation ? @"\t" : "[ ]{" + OptionScriptBlocksIndentationNumberOfSpaces + "}";
+            string indentRegexPattern = OptionsSyntaxRules.OptionScriptBlocksIndentation == ScriptBlocksIndentation.Tabulation ? @"\t" : "[ ]{" + OptionsSyntaxRules.OptionScriptBlocksIndentationNumberOfSpaces + "}";
 
             blockIndentationRegex = new Regex(@"^([\r\n]*((" + indentRegexPattern + @")+.*)([\r\n]|$)+)+", RegexOptions.Compiled);
             blockIndentationLevelTrimRegex = new Regex("^" + indentRegexPattern, RegexOptions.Compiled | RegexOptions.Multiline);
@@ -113,17 +113,17 @@ protected virtual void RefreshIndentedBlockDetection()
 
         protected virtual void RefreshEndOfExpressionDetection()
         {
-            nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionsSyntaxRules.OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshInstanceCreationKeywordRegexPattern()
         {
-            instanceCreationKeywordRegex = new Regex("^(" + string.Join("|", OptionNewKeywordAliases.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            instanceCreationKeywordRegex = new Regex("^(" + string.Join("|", OptionsSyntaxRules.KeywordNew.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionsFunctionalities.OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshCastRegex()
         {
-            castRegex = new Regex(@"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9" + (OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"\[\]<>]*[?]?)(?>\s*)\)", RegexOptions.Compiled);
+            castRegex = new Regex(@"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9" + (OptionsFunctionalities.OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"\[\]<>]*[?]?)(?>\s*)\)", RegexOptions.Compiled);
         }
 
         protected RegexOptions CompiledRegexOptionAndIfNecessaryIgnoreCase => OptionCaseSensitiveEvaluationActive ? RegexOptions.Compiled : RegexOptions.IgnoreCase | RegexOptions.Compiled;
@@ -637,6 +637,312 @@ public virtual IList<Assembly> Assemblies
 
         #region Options
 
+        #region Options base abstract class
+        public abstract class Options
+        {
+            protected ExpressionEvaluator evaluator;
+
+            protected Options(ExpressionEvaluator evaluator)
+            {
+                this.evaluator = evaluator;
+            }
+        }
+
+        #endregion
+
+        #region Functionalities options
+        public class FunctionalitiesActivation : Options
+        {
+            public FunctionalitiesActivation(ExpressionEvaluator evaluator) : base(evaluator) { }
+
+            /// <summary>
+            /// If <c>true</c> allow to add the prefix Fluid or Fluent before void methods names to return back the instance on which the method is call<para/>
+            /// If <c>false</c> unactive this functionality
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionFluidPrefixingActive { get; set; } = true;
+
+            private bool optionInlineNamespacesEvaluationActive = true;
+            /// <summary>
+            /// If <c>true</c> allow the use of inline namespace (Can be slow, and is less secure)<para/>
+            /// If <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available)
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionInlineNamespacesEvaluationActive
+            {
+                get { return optionInlineNamespacesEvaluationActive; }
+                set
+                {
+                    optionInlineNamespacesEvaluationActive = value;
+                    evaluator.RefreshInstanceCreationKeywordRegexPattern();
+                    evaluator.RefreshCastRegex();
+                }
+            }
+
+
+
+            /// <summary>
+            /// If <c>true</c> allow to create instance of object with the C# syntax new ClassName(...)<para/>
+            /// If <c>false</c> unactive this functionality.
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionNewKeywordEvaluationActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow to call static methods on classes.<para/>
+            /// If <c>false</c> unactive this functionality.
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionStaticMethodsCallActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow to get static properties on classes<para/>
+            /// If <c>false</c> unactive this functionality
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionStaticPropertiesGetActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow to call instance methods on objects<para/>
+            /// If <c>false</c> unactive this functionality
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionInstanceMethodsCallActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow to get instance properties on objects<para/>
+            /// If <c>false</c> unactive this functionality.
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionInstancePropertiesGetActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow to get object at index or key like IndexedObject[indexOrKey]<para/>
+            /// If <c>false</c> unactive this functionality.
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionIndexingActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow string interpretation with ""<para/>
+            /// If <c>false</c> unactive this functionality
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionStringEvaluationActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow char interpretation with ''<para/>
+            /// If <c>false</c> unactive this functionality
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionCharEvaluationActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> Evaluate function is callables in an expression. If <c>false</c> Evaluate is not callable<para/>
+            /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionEvaluateFunctionActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
+            /// If <c>false</c> unactive this functionality
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionVariableAssignationActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
+            /// If <c>false</c> unactive this functionality
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionPropertyOrFieldSetActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
+            /// If <c>false</c> unactive this functionality
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool OptionIndexingAssignationActive { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> ScriptEvaluate function is callables in an expression. If <c>false</c> Evaluate is not callable.
+            /// <para>Default value : <c>true</c></para>
+            /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
+            /// </summary>
+            public bool OptionScriptEvaluateFunctionActive { get; set; } = true;
+        }
+
+        /// <summary>
+        /// Options to activate or block functionalities of ExpressionEvaluator
+        /// </summary>
+        public FunctionalitiesActivation OptionsFunctionalities { get; private set; }
+
+        #endregion
+
+        #region Syntax rules options
+        public class SyntaxRules : Options
+        {
+            public SyntaxRules(ExpressionEvaluator evaluator) : base(evaluator) { }
+
+            private string[] keywordNew = new[] { "new" };
+            /// <summary>
+            /// To replace or specify aliases of the new keyword for creation of object instances
+            /// <para>Default value : <c>{"new"}</c></para>
+            /// </summary>
+            public string[] KeywordNew
+            {
+                get { return keywordNew; }
+                set
+                {
+                    keywordNew = value;
+                    evaluator.RefreshInstanceCreationKeywordRegexPattern();
+                }
+            }
+
+            private string[] optionScriptEndOfExpression = new[] { ";" };
+            /// <summary>
+            /// An array of string that are used to separate expressions in script
+            /// <para>Default value : <c>{";"}</c></para>
+            /// </summary>
+            public string[] OptionScriptEndOfExpression
+            {
+                get { return optionScriptEndOfExpression; }
+                set
+                {
+                    optionScriptEndOfExpression = value;
+                    evaluator.RefreshEndOfExpressionDetection();
+                }
+            }
+
+            /// <summary>
+            /// Allow to change the separator of functions arguments.
+            /// <para>Default value : <c>","</c></para>
+            /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
+            /// </summary>
+            public string OptionFunctionArgumentsSeparator { get; set; } = ",";
+
+            /// <summary>
+            /// Allow to change the separator of Object and collections Initialization between { and } after the keyword new.
+            /// <para>Default value : <c>","</c></para>
+            /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
+            /// </summary>
+            public string OptionInitializersSeparator { get; set; } = ",";
+
+            /// <summary>
+            /// The separator that separate each expression in block keyword's head
+            /// <para>Default value : <c>";"</c></para>
+            /// <example>Example : <code>for(int i = 0; i &lt; 10; i++)</code></example>
+            /// </summary>
+            public string OptionScriptBlockKeywordsHeadSubExpressionsSeparator { get; set; } = ";";
+
+            /// <summary>
+            /// To specify the character or string that end the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
+            /// <para>Default value : <c>")"</c></para>
+            /// </summary>
+            public string OptionScriptBlocksKeywordsHeadExpressionEndBracket { get; set; } = ")";
+
+            /// <summary>
+            /// To specify the character or string that separate the head statements and the block statements of script blocks keywords (if, else if, for, foreach while, do.. while)
+            /// <para>Default value : <c>":"</c></para>
+            /// </summary>
+            public string OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator { get; set; } = ":";
+
+            private SyntaxForHeadStatementInBlocksKeywords optionScriptSyntaxForHeadStatementInBlocksKeywords;
+            /// <summary>
+            /// Specify how to detect the separation between head expression and the block of code is made in script block keyword (if, else if, for, foreach while, do.. while)
+            /// <para>Default value : <c>HeadBrackets</c></para>
+            /// </summary>
+            public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatementInBlocksKeywords
+            {
+                get { return optionScriptSyntaxForHeadStatementInBlocksKeywords; }
+                set
+                {
+                    optionScriptSyntaxForHeadStatementInBlocksKeywords = value;
+                    evaluator.RefreshBlocksKeywordDetection();
+                }
+            }
+
+            private string optionScriptBlockStartBracket = "{";
+            /// <summary>
+            /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
+            /// <para>Default value : <c>"{"</c></para>
+            /// </summary>
+            public string OptionScriptBlockStartBracket
+            {
+                get { return optionScriptBlockStartBracket; }
+                set
+                {
+                    optionScriptBlockStartBracket = value;
+                    evaluator.isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
+                    evaluator.RefreshBlockStartDetection();
+                }
+            }
+
+            private string optionScriptBlockEndBracket = "}";
+            /// <summary>
+            /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
+            /// <para>Default value : <c>"}"</c></para>
+            /// </summary>
+            public string OptionScriptBlockEndBracket
+            {
+                get { return optionScriptBlockEndBracket; }
+                set
+                {
+                    optionScriptBlockEndBracket = value;
+                    evaluator.isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockEndBracket);
+                }
+            }
+
+            /// <summary>
+            /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
+            /// <para>Default value : <c>OptionalBracketsForStartAndEndWhenSingleStatement</c></para>
+            /// </summary>
+            public SyntaxForScriptBlocksIdentifier OptionScriptSyntaxForBlocksIdentifier { get; set; }
+
+            private ScriptBlocksIndentation optionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces;
+            /// <summary>
+            /// Specify the kind of indentation to use when :<para/>
+            /// <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c>
+            /// <para>When Set to Spaces ensure to set also <c>OptionScriptBlocksIndentationNumberOfSpaces</c></para>
+            /// <para>Default value : <c>ScriptBlocksIndentation.Spaces</c></para>
+            /// </summary>
+            public ScriptBlocksIndentation OptionScriptBlocksIndentation
+            {
+                get { return optionScriptBlocksIndentation; }
+                set
+                {
+                    optionScriptBlocksIndentation = value;
+                    evaluator.RefreshIndentedBlockDetection();
+                }
+            }
+
+            private int optionScriptBlocksIndentationNumberOfSpaces = 4;
+            /// <summary>
+            /// Set the number of spaces to use as an indentation when : <para/>
+            /// <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c><para/>
+            /// and<para/>
+            /// <c>OptionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces</c>
+            /// <para>Default value : <c>4</c></para>
+            /// </summary>
+            public int OptionScriptBlocksIndentationNumberOfSpaces
+            {
+                get { return optionScriptBlocksIndentationNumberOfSpaces; }
+                set
+                {
+                    optionScriptBlocksIndentationNumberOfSpaces = value;
+                    evaluator.RefreshIndentedBlockDetection();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Options to modify specific tokens/keywords/syntax parsing.
+        /// </summary>
+        public SyntaxRules OptionsSyntaxRules { get; private set; }
+
+        #endregion
+
         private bool optionCaseSensitiveEvaluationActive = true;
 
         /// <summary>
@@ -757,51 +1063,8 @@ public string OptionNumberParsingThousandSeparator
             }
         }
 
-        /// <summary>
-        /// Allow to change the separator of functions arguments.
-        /// <para>Default value : <c>","</c></para>
-        /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
-        /// </summary>
-        public string OptionFunctionArgumentsSeparator { get; set; } = ",";
-
-        /// <summary>
-        /// Allow to change the separator of Object and collections Initialization between { and } after the keyword new.
-        /// <para>Default value : <c>","</c></para>
-        /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
-        /// </summary>
-        public string OptionInitializersSeparator { get; set; } = ",";
-
-        /// <summary>
-        /// The separator that separate each expression in block keyword's head
-        /// <para>Default value : <c>";"</c></para>
-        /// <example>Example : <code>for(int i = 0; i &lt; 10; i++)</code></example>
-        /// </summary>
-        public string OptionScriptBlockKeywordsHeadSubExpressionsSeparator { get; set; } = ";";
-
-        /// <summary>
-        /// If <c>true</c> allow to add the prefix Fluid or Fluent before void methods names to return back the instance on which the method is call<para/>
-        /// If <c>false</c> unactive this functionality
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionFluidPrefixingActive { get; set; } = true;
-
-        private bool optionInlineNamespacesEvaluationActive = true;
-        /// <summary>
-        /// If <c>true</c> allow the use of inline namespace (Can be slow, and is less secure)<para/>
-        /// If <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available)
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionInlineNamespacesEvaluationActive
-        {
-            get { return optionInlineNamespacesEvaluationActive; }
-            set
-            {
-                optionInlineNamespacesEvaluationActive = value;
-                RefreshInstanceCreationKeywordRegexPattern();
-                RefreshCastRegex();
-            }
-        }
-
+        protected bool isBlockStartBracketAWord;
+        protected bool isBlockEndBracketAWord;
         private Func<ExpressionEvaluator, List<string>, object> newMethodMem;
 
         /// <summary>
@@ -829,112 +1092,6 @@ public bool OptionNewFunctionEvaluationActive
             }
         }
 
-        /// <summary>
-        /// If <c>true</c> allow to create instance of object with the C# syntax new ClassName(...)<para/>
-        /// If <c>false</c> unactive this functionality.
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionNewKeywordEvaluationActive { get; set; } = true;
-
-        private string[] optionNewKeywordAliases = new[] { "new" };
-        /// <summary>
-        /// To replace or specify aliases of the new keyword for creation of object instances
-        /// <para>Default value : <c>{"new"}</c></para>
-        /// </summary>
-        public string[] OptionNewKeywordAliases
-        {
-            get { return optionNewKeywordAliases; }
-            set
-            {
-                optionNewKeywordAliases = value;
-                RefreshInstanceCreationKeywordRegexPattern();
-            }
-        }
-
-        /// <summary>
-        /// If <c>true</c> allow to call static methods on classes.<para/>
-        /// If <c>false</c> unactive this functionality.
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionStaticMethodsCallActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow to get static properties on classes<para/>
-        /// If <c>false</c> unactive this functionality
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionStaticPropertiesGetActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow to call instance methods on objects<para/>
-        /// If <c>false</c> unactive this functionality
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionInstanceMethodsCallActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow to get instance properties on objects<para/>
-        /// If <c>false</c> unactive this functionality.
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionInstancePropertiesGetActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow to get object at index or key like IndexedObject[indexOrKey]<para/>
-        /// If <c>false</c> unactive this functionality.
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionIndexingActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow string interpretation with ""<para/>
-        /// If <c>false</c> unactive this functionality
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionStringEvaluationActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow char interpretation with ''<para/>
-        /// If <c>false</c> unactive this functionality
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionCharEvaluationActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> Evaluate function is callables in an expression. If <c>false</c> Evaluate is not callable<para/>
-        /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionEvaluateFunctionActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
-        /// If <c>false</c> unactive this functionality
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionVariableAssignationActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
-        /// If <c>false</c> unactive this functionality
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionPropertyOrFieldSetActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
-        /// If <c>false</c> unactive this functionality
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionIndexingAssignationActive { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> ScriptEvaluate function is callables in an expression. If <c>false</c> Evaluate is not callable.
-        /// <para>Default value : <c>true</c></para>
-        /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
-        /// </summary>
-        public bool OptionScriptEvaluateFunctionActive { get; set; } = true;
-
         /// <summary>
         /// If <c>ReturnAutomaticallyLastEvaluatedExpression</c> ScriptEvaluate return automatically the last evaluated expression if no return keyword is met<para/>
         /// If <c>ReturnNull</c> return null if no return keyword is met<para/>
@@ -943,21 +1100,6 @@ public string[] OptionNewKeywordAliases
         /// </summary>
         public OptionOnNoReturnKeywordFoundInScriptAction OptionOnNoReturnKeywordFoundInScriptAction { get; set; }
 
-        private string[] optionScriptEndOfExpression = new[] { ";" };
-        /// <summary>
-        /// An array of string that are used to separate expressions in script
-        /// <para>Default value : <c>{";"}</c></para>
-        /// </summary>
-        public string[] OptionScriptEndOfExpression
-        {
-            get { return optionScriptEndOfExpression; }
-            set
-            {
-                optionScriptEndOfExpression = value;
-                RefreshEndOfExpressionDetection();
-            }
-        }
-
         /// <summary>
         /// Specify to skip the evaluation of an empty expression in scripts otherwise it will throw an exception.
         /// For example when two semicolon ;; are present or when there are empty line with OptionScriptEndOfExpression set to end of line characters { "\r\n", "\r", "\n" }
@@ -987,107 +1129,6 @@ public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
             }
         }
 
-        /// <summary>
-        /// To specify the character or string that end the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// <para>Default value : <c>")"</c></para>
-        /// </summary>
-        public string OptionScriptBlocksKeywordsHeadExpressionEndBracket { get; set; } = ")";
-
-        /// <summary>
-        /// To specify the character or string that separate the head statements and the block statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// <para>Default value : <c>":"</c></para>
-        /// </summary>
-        public string OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator { get; set; } = ":";
-
-        private SyntaxForHeadStatementInBlocksKeywords optionScriptSyntaxForHeadStatementInBlocksKeywords;
-        /// <summary>
-        /// Specify how to detect the separation between head expression and the block of code is made in script block keyword (if, else if, for, foreach while, do.. while)
-        /// <para>Default value : <c>HeadBrackets</c></para>
-        /// </summary>
-        public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatementInBlocksKeywords
-        {
-            get { return optionScriptSyntaxForHeadStatementInBlocksKeywords; }
-            set
-            {
-                optionScriptSyntaxForHeadStatementInBlocksKeywords = value;
-                RefreshBlocksKeywordDetection();
-            }
-        }
-
-        protected bool isBlockStartBracketAWord;
-        private string optionScriptBlockStartBracket = "{";
-        /// <summary>
-        /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
-        /// <para>Default value : <c>"{"</c></para>
-        /// </summary>
-        public string OptionScriptBlockStartBracket
-        {
-            get { return optionScriptBlockStartBracket; }
-            set
-            {
-                optionScriptBlockStartBracket = value;
-                isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
-                RefreshBlockStartDetection();
-            }
-        }
-
-        protected bool isBlockEndBracketAWord;
-        private string optionScriptBlockEndBracket = "}";
-        /// <summary>
-        /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
-        /// <para>Default value : <c>"}"</c></para>
-        /// </summary>
-        public string OptionScriptBlockEndBracket
-        {
-            get { return optionScriptBlockEndBracket; }
-            set
-            {
-                optionScriptBlockEndBracket = value;
-                isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockEndBracket);
-            }
-        }
-
-        /// <summary>
-        /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
-        /// <para>Default value : <c>OptionalBracketsForStartAndEndWhenSingleStatement</c></para>
-        /// </summary>
-        public SyntaxForScriptBlocksIdentifier OptionScriptSyntaxForBlocksIdentifier { get; set; }
-
-        private ScriptBlocksIndentation optionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces;
-        /// <summary>
-        /// Specify the kind of indentation to use when :<para/>
-        /// <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c>
-        /// <para>When Set to Spaces ensure to set also <c>OptionScriptBlocksIndentationNumberOfSpaces</c></para>
-        /// <para>Default value : <c>ScriptBlocksIndentation.Spaces</c></para>
-        /// </summary>
-        public ScriptBlocksIndentation OptionScriptBlocksIndentation
-        {
-            get { return optionScriptBlocksIndentation; }
-            set
-            {
-                optionScriptBlocksIndentation = value;
-                RefreshIndentedBlockDetection();
-            }
-        }
-
-        private int optionScriptBlocksIndentationNumberOfSpaces = 4;
-        /// <summary>
-        /// Set the number of spaces to use as an indentation when : <para/>
-        /// <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c><para/>
-        /// and<para/>
-        /// <c>OptionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces</c>
-        /// <para>Default value : <c>4</c></para>
-        /// </summary>
-        public int OptionScriptBlocksIndentationNumberOfSpaces
-        {
-            get { return optionScriptBlocksIndentationNumberOfSpaces; }
-            set
-            {
-                optionScriptBlocksIndentationNumberOfSpaces = value;
-                RefreshIndentedBlockDetection();
-            }
-        }
-
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)<para/>
         /// If <c>false</c> Allow to access only to public members.
@@ -1229,7 +1270,7 @@ public IDictionary<string, object> Variables
         /// </summary>
         public ExpressionEvaluator()
         {
-            DefaultDecimalSeparatorInit();
+            OptionsInit();
 
             Init();
         }
@@ -1263,11 +1304,13 @@ public ExpressionEvaluator(object context, IDictionary<string, object> variables
             Variables = variables;
         }
 
-        protected virtual void DefaultDecimalSeparatorInit()
+        protected virtual void OptionsInit()
         {
             numberRegexPattern = string.Format(numberRegexOrigPattern, @"\.", string.Empty);
-
             CultureInfoForNumberParsing.NumberFormat.NumberDecimalSeparator = ".";
+
+            OptionsFunctionalities = new FunctionalitiesActivation(this);
+            OptionsSyntaxRules = new SyntaxRules(this);
         }
 
         protected virtual void Init()
@@ -1362,21 +1405,21 @@ void ExecuteBlocksStacks()
 
                     if (blockKeywordsBeginingMatch.Success)
                     {
-                        if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
-                            || (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any && !blockKeywordsBeginingMatch.Groups["startBracket"].Success))
+                        if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                            || (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any && !blockKeywordsBeginingMatch.Groups["startBracket"].Success))
                         {
-                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator, null, OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator);
+                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadSubExpressionsSeparator, null, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator);
                         }
                         else
                         {
-                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator, OptionScriptBlocksKeywordsHeadStatementsStartBracket, OptionScriptBlocksKeywordsHeadExpressionEndBracket);
+                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadSubExpressionsSeparator, OptionScriptBlocksKeywordsHeadStatementsStartBracket, OptionsSyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket);
 
-                            if (OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.HeadBrackets)
+                            if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.HeadBrackets)
                             {
                                 Match blockKeywordsHeadAndBodySeparatorMatch = blockKeywordsHeadAndBodySeparatorRegex.Match(script.Substring(i + 1));
 
-                                if (OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Both && !blockKeywordsHeadAndBodySeparatorMatch.Success)
-                                    throw new ExpressionEvaluatorSyntaxErrorException($"A Separator Token [{OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator}] was expected after the [{keyword}] keyword head expression");
+                                if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Both && !blockKeywordsHeadAndBodySeparatorMatch.Success)
+                                    throw new ExpressionEvaluatorSyntaxErrorException($"A Separator Token [{OptionsSyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator}] was expected after the [{keyword}] keyword head expression");
 
                                 i += blockKeywordsHeadAndBodySeparatorMatch.Length;
                             }
@@ -1387,7 +1430,7 @@ void ExecuteBlocksStacks()
 
                     string subScript = string.Empty;
 
-                    if (OptionScriptSyntaxForBlocksIdentifier == SyntaxForScriptBlocksIdentifier.Indentation)
+                    if (OptionsSyntaxRules.OptionScriptSyntaxForBlocksIdentifier == SyntaxForScriptBlocksIdentifier.Indentation)
                     {
                         Match blockIndentationMatch = blockIndentationRegex.Match(script.Substring(i));
                         if (blockIndentationMatch.Success)
@@ -1416,8 +1459,8 @@ void ExecuteBlocksStacks()
                         }
                         else
                         {
-                            if (OptionScriptSyntaxForBlocksIdentifier == SyntaxForScriptBlocksIdentifier.MandatoryBracketsForStartAndEnd)
-                                throw new ExpressionEvaluatorSyntaxErrorException($"$A block of code must be defined between \"{OptionScriptBlockStartBracket}\" and \"{OptionScriptBlockEndBracket}\" after a [{keyword}] keyword");
+                            if (OptionsSyntaxRules.OptionScriptSyntaxForBlocksIdentifier == SyntaxForScriptBlocksIdentifier.MandatoryBracketsForStartAndEnd)
+                                throw new ExpressionEvaluatorSyntaxErrorException($"$A block of code must be defined between \"{OptionsSyntaxRules.OptionScriptBlockStartBracket}\" and \"{OptionsSyntaxRules.OptionScriptBlockEndBracket}\" after a [{keyword}] keyword");
 
                             bool continueExpressionParsing = true;
                             startOfExpression = i;
@@ -1425,7 +1468,7 @@ void ExecuteBlocksStacks()
                             while (i < script.Length && continueExpressionParsing)
                             {
                                 if (TryParseStringAndParenthesesAndCurlyBrackets(script, ref i)) { }
-                                else if (script.Length - i >= 3 && OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
+                                else if (script.Length - i >= 3 && OptionsSyntaxRules.OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
                                 {
                                     i += 2;
                                 }
@@ -1433,7 +1476,7 @@ void ExecuteBlocksStacks()
                                 {
                                     subScript = script.Substring(startOfExpression, i + 1 - startOfExpression);
                                     continueExpressionParsing = false;
-                                    i += OptionScriptEndOfExpression.Length - 1;
+                                    i += OptionsSyntaxRules.OptionScriptEndOfExpression.Length - 1;
                                 }
 
                                 i++;
@@ -1514,7 +1557,7 @@ void ExecuteBlocksStacks()
                                 && blockKeywordsBeginingMatch.Groups["keyword"].Value.Equals("while", StringComparisonForCasing))
                             {
                                 i += blockKeywordsBeginingMatch.Length;
-                                keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionScriptBlockKeywordsHeadSubExpressionsSeparator);
+                                keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadSubExpressionsSeparator);
 
                                 i++;
 
@@ -1542,7 +1585,7 @@ void ExecuteBlocksStacks()
                                 }
                                 else
                                 {
-                                    throw new ExpressionEvaluatorSyntaxErrorException($"A [{OptionScriptEndOfExpression}] is missing. (After the do while condition)");
+                                    throw new ExpressionEvaluatorSyntaxErrorException($"A [{OptionsSyntaxRules.OptionScriptEndOfExpression}] is missing. (After the do while condition)");
                                 }
                             }
                             else
@@ -1635,7 +1678,7 @@ void forAction(int index)
                     Match nextIsEndOfExpressionMatch;
 
                     if (TryParseStringAndParenthesesAndCurlyBrackets(script, ref i)) { }
-                    else if (script.Length - i >= 3 && OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
+                    else if (script.Length - i >= 3 && OptionsSyntaxRules.OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
                     {
                         i += 2;
                     }
@@ -1663,7 +1706,7 @@ void forAction(int index)
             }
 
             if (!script.Substring(startOfExpression).Trim().Equals(string.Empty) && !isReturn && !isBreak && !isContinue && OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression)
-                throw new ExpressionEvaluatorSyntaxErrorException($"An end of expression [{string.Join(",", OptionScriptEndOfExpression.Select(s => "\"" + Regex.Escape(s) + "\""))}] token is missing.");
+                throw new ExpressionEvaluatorSyntaxErrorException($"An end of expression [{string.Join(",", OptionsSyntaxRules.OptionScriptEndOfExpression.Select(s => "\"" + Regex.Escape(s) + "\""))}] token is missing.");
 
             ExecuteBlocksStacks();
 
@@ -1845,9 +1888,9 @@ protected virtual bool TryParseStringAndParenthesesAndCurlyBrackets(string scrip
                 index++;
                 GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref index, false);
             }
-            else if (script.Substring(index).StartsWith(OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, index - 1, index + OptionScriptBlockStartBracket.Length)))
+            else if (script.Substring(index).StartsWith(OptionsSyntaxRules.OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, index - 1, index + OptionsSyntaxRules.OptionScriptBlockStartBracket.Length)))
             {
-                index += OptionScriptBlockStartBracket.Length;
+                index += OptionsSyntaxRules.OptionScriptBlockStartBracket.Length;
                 GetScriptBetweenBlockBrackets(script, ref index);
             }
             else
@@ -2035,7 +2078,7 @@ protected virtual bool EvaluateNumber(string expression, Stack<object> stack, re
 
         protected virtual bool EvaluateInstanceCreationWithNewKeyword(string expression, Stack<object> stack, ref int i)
         {
-            if (!OptionNewKeywordEvaluationActive)
+            if (!OptionsFunctionalities.OptionNewKeywordEvaluationActive)
                 return false;
 
             Match instanceCreationMatch = instanceCreationKeywordRegex.Match(expression.Substring(i));
@@ -2044,7 +2087,7 @@ protected virtual bool EvaluateInstanceCreationWithNewKeyword(string expression,
                 && (stack.Count == 0
                 || stack.Peek() is ExpressionOperator))
             {
-                void InitSimpleObjet(object element, List<string> initArgs)
+                void InitSimpleObject(object element, List<string> initArgs)
                 {
                     string variable = "V" + Guid.NewGuid().ToString().Replace("-", "");
 
@@ -2073,9 +2116,9 @@ void InitSimpleObjet(object element, List<string> initArgs)
                 {
                     object element = new ExpandoObject();
 
-                    List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionInitializersSeparator, "{", "}");
+                    List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
 
-                    InitSimpleObjet(element, initArgs);
+                    InitSimpleObject(element, initArgs);
 
                     stack.Push(element);
                 }
@@ -2106,7 +2149,7 @@ void Init(object element, List<string> initArgs)
                             {
                                 int subIndex = subExpr.IndexOf("{") + 1;
 
-                                List<string> subArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(subExpr, ref subIndex, true, OptionInitializersSeparator, "{", "}");
+                                List<string> subArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(subExpr, ref subIndex, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
 
                                 if (subArgs.Count == 2)
                                 {
@@ -2122,13 +2165,13 @@ void Init(object element, List<string> initArgs)
                         }
                         else
                         {
-                            InitSimpleObjet(element, initArgs);
+                            InitSimpleObject(element, initArgs);
                         }
                     }
 
                     if (instanceCreationMatch.Groups["isfunction"].Success)
                     {
-                        List<string> constructorArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionFunctionArgumentsSeparator);
+                        List<string> constructorArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionFunctionArgumentsSeparator);
                         i++;
 
                         List<object> cArgs = constructorArgs.ConvertAll(Evaluate);
@@ -2141,7 +2184,7 @@ void Init(object element, List<string> initArgs)
                         {
                             i += blockBeginningMatch.Length;
 
-                            List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionInitializersSeparator, "{", "}");
+                            List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
 
                             Init(element, initArgs);
                         }
@@ -2156,7 +2199,7 @@ void Init(object element, List<string> initArgs)
                     {
                         object element = Activator.CreateInstance(type, new object[0]);
 
-                        List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionInitializersSeparator, "{", "}");
+                        List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
 
                         Init(element, initArgs);
 
@@ -2164,7 +2207,7 @@ void Init(object element, List<string> initArgs)
                     }
                     else if (instanceCreationMatch.Groups["isArray"].Success)
                     {
-                        List<string> arrayArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionInitializersSeparator, "[", "]");
+                        List<string> arrayArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "[", "]");
                         i++;
                         Array array = null;
 
@@ -2179,7 +2222,7 @@ void Init(object element, List<string> initArgs)
                         {
                             i += initInNewBeginningMatch.Length;
 
-                            List<string> arrayElements = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionInitializersSeparator, "{", "}");
+                            List<string> arrayElements = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
 
                             if (array == null)
                                 array = Array.CreateInstance(type, arrayElements.Count);
@@ -2228,7 +2271,7 @@ protected virtual bool EvaluateVarOrFunc(string expression, Stack<object> stack,
 
                 if (varFuncMatch.Groups["isfunction"].Success)
                 {
-                    List<string> funcArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionFunctionArgumentsSeparator);
+                    List<string> funcArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionFunctionArgumentsSeparator);
 
                     if (inObject
                         || Context?.GetType()
@@ -2325,9 +2368,9 @@ protected virtual bool EvaluateVarOrFunc(string expression, Stack<object> stack,
 
                                     BindingFlags flag = DetermineInstanceOrStatic(ref objType, ref obj, ref valueTypeNestingTrace);
 
-                                    if (!OptionStaticMethodsCallActive && (flag & BindingFlags.Static) != 0)
+                                    if (!OptionsFunctionalities.OptionStaticMethodsCallActive && (flag & BindingFlags.Static) != 0)
                                         throw new ExpressionEvaluatorSyntaxErrorException($"[{objType}] object has no Method named \"{varFuncName}\".");
-                                    if (!OptionInstanceMethodsCallActive && (flag & BindingFlags.Instance) != 0)
+                                    if (!OptionsFunctionalities.OptionInstanceMethodsCallActive && (flag & BindingFlags.Instance) != 0)
                                         throw new ExpressionEvaluatorSyntaxErrorException($"[{objType}] object has no Method named \"{varFuncName}\".");
 
                                     // Standard Instance or public method find
@@ -2547,9 +2590,9 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
                                 {
                                     BindingFlags flag = DetermineInstanceOrStatic(ref objType, ref obj, ref valueTypeNestingTrace);
 
-                                    if (!OptionStaticPropertiesGetActive && (flag & BindingFlags.Static) != 0)
+                                    if (!OptionsFunctionalities.OptionStaticPropertiesGetActive && (flag & BindingFlags.Static) != 0)
                                         throw new ExpressionEvaluatorSyntaxErrorException($"[{objType}] object has no public Property or Field named \"{varFuncName}\".");
-                                    if (!OptionInstancePropertiesGetActive && (flag & BindingFlags.Instance) != 0)
+                                    if (!OptionsFunctionalities.OptionInstancePropertiesGetActive && (flag & BindingFlags.Instance) != 0)
                                         throw new ExpressionEvaluatorSyntaxErrorException($"[{objType}] object has no public Property or Field named \"{varFuncName}\".");
 
                                     bool isDynamic = (flag & BindingFlags.Instance) != 0 && obj is IDynamicMetaObjectProvider && obj is IDictionary<string, object>;
@@ -2606,7 +2649,7 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
                                         stack.Push(varValue);
                                     }
 
-                                    if (OptionPropertyOrFieldSetActive)
+                                    if (OptionsFunctionalities.OptionPropertyOrFieldSetActive)
                                     {
                                         if (varFuncMatch.Groups["assignationOperator"].Success)
                                         {
@@ -2714,7 +2757,7 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
 
                             stack.Push(cusVarValueToPush);
 
-                            if (OptionVariableAssignationActive)
+                            if (OptionsFunctionalities.OptionVariableAssignationActive)
                             {
                                 bool assign = true;
 
@@ -2756,7 +2799,7 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
                             string typeName = $"{varFuncName}{((i < expression.Length && expression.Substring(i)[0] == '?') ? "?" : "") }";
                             Type staticType = GetTypeByFriendlyName(typeName, genericsTypes);
 
-                            if (staticType == null && OptionInlineNamespacesEvaluationActive)
+                            if (staticType == null && OptionsFunctionalities.OptionInlineNamespacesEvaluationActive)
                             {
                                 int subIndex = 0;
                                 Match namespaceMatch = varOrFunctionRegEx.Match(expression.Substring(i + subIndex));
@@ -2830,7 +2873,7 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
 
         protected virtual bool EvaluateChar(string expression, Stack<object> stack, ref int i)
         {
-            if (!OptionCharEvaluationActive)
+            if (!OptionsFunctionalities.OptionCharEvaluationActive)
                 return false;
 
             string s = expression.Substring(i, 1);
@@ -2998,7 +3041,7 @@ protected virtual void CorrectStackWithUnaryPlusOrMinusBeforeParenthisIfNecessar
 
         protected virtual bool EvaluateIndexing(string expression, Stack<object> stack, ref int i)
         {
-            if (!OptionIndexingActive)
+            if (!OptionsFunctionalities.OptionIndexingActive)
                 return false;
 
             Match indexingBeginningMatch = indexingBeginningRegex.Match(expression.Substring(i));
@@ -3076,7 +3119,7 @@ protected virtual bool EvaluateIndexing(string expression, Stack<object> stack,
 
                     dynamic valueToPush = null;
 
-                    if (OptionIndexingAssignationActive && (assignationOrPostFixOperatorMatch = assignationOrPostFixOperatorRegex.Match(expression.Substring(i + 1))).Success)
+                    if (OptionsFunctionalities.OptionIndexingAssignationActive && (assignationOrPostFixOperatorMatch = assignationOrPostFixOperatorRegex.Match(expression.Substring(i + 1))).Success)
                     {
                         i += assignationOrPostFixOperatorMatch.Length + 1;
 
@@ -3124,7 +3167,7 @@ protected virtual bool EvaluateIndexing(string expression, Stack<object> stack,
 
         protected virtual bool EvaluateString(string expression, Stack<object> stack, ref int i)
         {
-            if (!OptionStringEvaluationActive)
+            if (!OptionsFunctionalities.OptionStringEvaluationActive)
                 return false;
 
             Match stringBeginningMatch = stringBeginningRegex.Match(expression.Substring(i));
@@ -3568,7 +3611,7 @@ protected virtual MethodInfo GetRealMethod(ref Type type, ref object obj, string
             List<object> modifiedArgs = new List<object>(args);
             Type typeCopy = type;
 
-            if (OptionFluidPrefixingActive
+            if (OptionsFunctionalities.OptionFluidPrefixingActive
                 && (func.StartsWith("Fluid", StringComparisonForCasing)
                     || func.StartsWith("Fluent", StringComparisonForCasing)))
             {
@@ -3868,15 +3911,15 @@ protected virtual string GetScriptBetweenBlockBrackets(string parentScript, ref
                 {
                     s = parentScript.Substring(index);
 
-                    if (s.StartsWith(OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionScriptBlockStartBracket.Length)))
+                    if (s.StartsWith(OptionsSyntaxRules.OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionsSyntaxRules.OptionScriptBlockStartBracket.Length)))
                     {
                         bracketCount++;
-                        index += OptionScriptBlockStartBracket.Length - 1;
+                        index += OptionsSyntaxRules.OptionScriptBlockStartBracket.Length - 1;
                     }
-                    else if (s.StartsWith(OptionScriptBlockEndBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionScriptBlockEndBracket.Length)))
+                    else if (s.StartsWith(OptionsSyntaxRules.OptionScriptBlockEndBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionsSyntaxRules.OptionScriptBlockEndBracket.Length)))
                     {
                         bracketCount--;
-                        index += OptionScriptBlockEndBracket.Length - 1;
+                        index += OptionsSyntaxRules.OptionScriptBlockEndBracket.Length - 1;
                         if (bracketCount == 0)
                             break;
                     }
@@ -3891,7 +3934,7 @@ protected virtual string GetScriptBetweenBlockBrackets(string parentScript, ref
             {
                 string beVerb = bracketCount == 1 ? "is" : "are";
                 string singularPlurial = bracketCount == 1 ? "" : "s";
-                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} [{OptionScriptBlockEndBracket}] (end of block) token{singularPlurial} {beVerb} missing in script at : [{index}]");
+                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} [{OptionsSyntaxRules.OptionScriptBlockEndBracket}] (end of block) token{singularPlurial} {beVerb} missing in script at : [{index}]");
             }
 
             return currentScript;
@@ -3909,13 +3952,13 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                 Match internalStringMatch = stringBeginningRegex.Match(subExpr);
                 Match internalCharMatch = internalCharRegex.Match(subExpr);
 
-                if (OptionStringEvaluationActive && internalStringMatch.Success)
+                if (OptionsFunctionalities.OptionStringEvaluationActive && internalStringMatch.Success)
                 {
                     string innerString = internalStringMatch.Value + GetCodeUntilEndOfString(expression.Substring(i + internalStringMatch.Length), internalStringMatch);
                     currentExpression += innerString;
                     i += innerString.Length - 1;
                 }
-                else if (OptionCharEvaluationActive && internalCharMatch.Success)
+                else if (OptionsFunctionalities.OptionCharEvaluationActive && internalCharMatch.Success)
                 {
                     currentExpression += internalCharMatch.Value;
                     i += internalCharMatch.Length - 1;
@@ -3994,11 +4037,11 @@ protected virtual bool DefaultFunctions(string name, List<string> args, out obje
             {
                 result = complexFunc(this, args);
             }
-            else if (OptionEvaluateFunctionActive && name.Equals("Evaluate", StringComparisonForCasing))
+            else if (OptionsFunctionalities.OptionEvaluateFunctionActive && name.Equals("Evaluate", StringComparisonForCasing))
             {
                 result = Evaluate((string)Evaluate(args[0]));
             }
-            else if (OptionScriptEvaluateFunctionActive && name.Equals("ScriptEvaluate", StringComparisonForCasing))
+            else if (OptionsFunctionalities.OptionScriptEvaluateFunctionActive && name.Equals("ScriptEvaluate", StringComparisonForCasing))
             {
                 bool oldInScript = inScript;
                 result = ScriptEvaluate((string)Evaluate(args[0]));

From 9d4638c003fb9a3ddad77488c457facd5004f784 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 11 May 2021 13:37:59 +0200
Subject: [PATCH 33/48] Small refactoring

---
 .../ExpressionEvaluator.cs                          | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 7f41563..5a6cebd 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -649,7 +649,6 @@ public bool OptionCaseSensitiveEvaluationActive
             set
             {
                 optionCaseSensitiveEvaluationActive = value;
-                StringComparisonForCasing = optionCaseSensitiveEvaluationActive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
                 Variables = Variables;
                 operatorsDictionary = new Dictionary<string, ExpressionOperator>(operatorsDictionary, StringComparerForCasing);
                 defaultVariables = new Dictionary<string, object>(defaultVariables, StringComparerForCasing);
@@ -663,15 +662,9 @@ public bool OptionCaseSensitiveEvaluationActive
             }
         }
 
-        private StringComparison StringComparisonForCasing { get; set; } = StringComparison.Ordinal;
+        protected StringComparison StringComparisonForCasing => OptionCaseSensitiveEvaluationActive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
 
-        protected StringComparer StringComparerForCasing
-        {
-            get
-            {
-                return OptionCaseSensitiveEvaluationActive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase;
-            }
-        }
+        protected StringComparer StringComparerForCasing => OptionCaseSensitiveEvaluationActive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase;
 
         /// <summary>
         /// If <c>true</c> all numbers without decimal and suffixes evaluations will be done as double<para/>
@@ -1089,7 +1082,7 @@ public int OptionScriptBlocksIndentationNumberOfSpaces
 
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)<para/>
-        /// If <c>false</c> Allow to access only to public members.
+        /// If <c>false</c> Allow access only to public members.
         /// <para>Default value : <c>false</c></para>
         /// Warning : This clearly break the encapsulation principle use this only if you know what you do.
         /// </summary>

From a77e7e4d426cff4ea2d47c45e6116cd8b2a17bbe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien?= <sebgeiser@gmail.com>
Date: Wed, 12 May 2021 16:59:07 +0200
Subject: [PATCH 34/48] Correction of the merge

---
 .../ExpressionEvaluator.cs                    | 36 +------------------
 1 file changed, 1 insertion(+), 35 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 5b72a9d..5653e54 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -678,8 +678,6 @@ public bool OptionInlineNamespacesEvaluationActive
                 }
             }
 
-
-
             /// <summary>
             /// If <c>true</c> allow to create instance of object with the C# syntax new ClassName(...)<para/>
             /// If <c>false</c> unactive this functionality.
@@ -2823,38 +2821,6 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
                         {
                             Type staticType = EvaluateType(expression, ref i, varFuncName, genericsTypes);
 
-                            if (staticType == null && OptionsFunctionalities.OptionInlineNamespacesEvaluationActive)
-                            {
-                                int subIndex = 0;
-                                Match namespaceMatch = varOrFunctionRegEx.Match(expression.Substring(i + subIndex));
-
-                                while (staticType == null
-                                    && namespaceMatch.Success
-                                    && !namespaceMatch.Groups["sign"].Success
-                                    && !namespaceMatch.Groups["assignationOperator"].Success
-                                    && !namespaceMatch.Groups["postfixOperator"].Success
-                                    && !namespaceMatch.Groups["isfunction"].Success
-                                    && i + subIndex < expression.Length
-                                    && !typeName.EndsWith("?"))
-                                {
-                                    subIndex += namespaceMatch.Length;
-                                    typeName += $".{namespaceMatch.Groups["name"].Value}{((i + subIndex < expression.Length && expression.Substring(i + subIndex)[0] == '?') ? "?" : "") }";
-
-                                    staticType = GetTypeByFriendlyName(typeName, namespaceMatch.Groups["isgeneric"].Value);
-
-                                    if (staticType != null)
-                                    {
-                                        i += subIndex;
-                                        break;
-                                    }
-
-                                    namespaceMatch = varOrFunctionRegEx.Match(expression.Substring(i + subIndex));
-                                }
-                            }
-
-                            if (typeName.EndsWith("?") && staticType != null)
-                                i++;
-
                             if (staticType != null)
                             {
                                 stack.Push(new ClassOrEnumType() { Type = staticType });
@@ -2901,7 +2867,7 @@ protected virtual Type EvaluateType(string expression,ref int i, string currentN
             Type staticType = GetTypeByFriendlyName(typeName, genericsTypes);
 
             // For inline namespace parsing
-            if (staticType == null && OptionInlineNamespacesEvaluationActive)
+            if (staticType == null && OptionsFunctionalities.OptionInlineNamespacesEvaluationActive)
             {
                 int subIndex = 0;
                 Match namespaceMatch = varOrFunctionRegEx.Match(expression.Substring(i + subIndex));

From e6e78a89b610aa2104261c74bbce58808bca9c5a Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 19 May 2021 17:14:16 +0200
Subject: [PATCH 35/48] Pfiuu. Finally Tests pass again after first step of
 options refactoring

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs | 179 ++++++++++++------
 .../ExpressionEvaluatorTests.cs               |  60 ++++--
 .../ExpressionEvaluator.cs                    | 120 ++++++++----
 3 files changed, 252 insertions(+), 107 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 102043d..640d9ca 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1433,20 +1433,26 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator01 = new ExpressionEvaluator()
                 {
-                    OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
+                    },
                     OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false
                 };
 
                 yield return new TestCaseData(Resources.Script0074, flexibleScriptSyntaxEvaluator01, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptEndOfExpression))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptEndOfExpression))
                     .SetCategory(nameof(ExpressionEvaluator.OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression))
                     .Returns(8);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0075.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)), flexibleScriptSyntaxEvaluator02, null, null, null)
@@ -1481,7 +1487,10 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator03 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Any
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Any
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0075.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Any)), flexibleScriptSyntaxEvaluator03, null, null, null)
@@ -1528,7 +1537,10 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator04 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0077.Replace("[infos]", nameof(SyntaxForHeadStatementInBlocksKeywords.Both)), flexibleScriptSyntaxEvaluator04, null, null, null)
@@ -1551,103 +1563,121 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator05 = new ExpressionEvaluator()
                 {
-                    OptionScriptBlocksKeywordsHeadStatementsStartBracket = "|",
-                    OptionScriptBlocksKeywordsHeadExpressionEndBracket = "|"
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptBlocksKeywordsHeadStatementsStartBracket = "|",
+                        OptionScriptBlocksKeywordsHeadExpressionEndBracket = "|"
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0082, flexibleScriptSyntaxEvaluator05, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0083, flexibleScriptSyntaxEvaluator05, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator06 = new ExpressionEvaluator()
                 {
-                    OptionScriptBlocksKeywordsHeadStatementsStartBracket = "{",
-                    OptionScriptBlocksKeywordsHeadExpressionEndBracket = "}"
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptBlocksKeywordsHeadStatementsStartBracket = "{",
+                        OptionScriptBlocksKeywordsHeadExpressionEndBracket = "}"
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0084, flexibleScriptSyntaxEvaluator06, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0085, flexibleScriptSyntaxEvaluator06, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator07 = new ExpressionEvaluator()
                 {
-                    OptionScriptBlocksKeywordsHeadStatementsStartBracket = "<[",
-                    OptionScriptBlocksKeywordsHeadExpressionEndBracket = "]>"
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptBlocksKeywordsHeadStatementsStartBracket = "<[",
+                        OptionScriptBlocksKeywordsHeadExpressionEndBracket = "]>"
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0086, flexibleScriptSyntaxEvaluator07, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0087, flexibleScriptSyntaxEvaluator07, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator08 = new ExpressionEvaluator()
                 {
-                    OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator = "=>",
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator = "=>",
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0088, flexibleScriptSyntaxEvaluator08, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0089, flexibleScriptSyntaxEvaluator08, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator09 = new ExpressionEvaluator()
                 {
-                    OptionScriptBlockStartBracket = "(",
-                    OptionScriptBlockEndBracket = ")"
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptBlockStartBracket = "(",
+                        OptionScriptBlockEndBracket = ")"
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0090, flexibleScriptSyntaxEvaluator09, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator10 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
-                    OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator = "then",
-                    OptionScriptBlockStartBracket = "begin",
-                    OptionScriptBlockEndBracket = "end"
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
+                        OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator = "then",
+                        OptionScriptBlockStartBracket = "begin",
+                        OptionScriptBlockEndBracket = "end"
+                    }
                 };
 
                 flexibleScriptSyntaxEvaluator10.ImbricableBracketsPairing["begin"] = "end";
@@ -1655,9 +1685,9 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0091, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockEndBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
@@ -1665,9 +1695,9 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0092, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockEndBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
@@ -1675,28 +1705,37 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0093, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockEndBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
 
-                yield return new TestCaseData(Resources.Script0094, new ExpressionEvaluator() {OptionNewKeywordAliases = new[] { "->" } }, null, null, null)
+                yield return new TestCaseData(Resources.Script0094, new ExpressionEvaluator() { OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules() { KeywordNew = new[] { "->" } } }, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionNewKeywordAliases))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.KeywordNew))
                     .Returns(2);
 
-                yield return new TestCaseData(Resources.Script0095, new ExpressionEvaluator() {OptionNewKeywordAliases = new[] { "new", "create" } }, null, null, null)
+                yield return new TestCaseData(Resources.Script0095, new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            KeywordNew = new[] { "new", "create" }
+                        }
+                    }, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.OptionNewKeywordAliases))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.KeywordNew))
                     .Returns(12);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator11 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0096, flexibleScriptSyntaxEvaluator11, null, null, null)
@@ -1708,8 +1747,11 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator12 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
-                    OptionScriptBlocksIndentation = ScriptBlocksIndentation.Tabulation
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
+                        OptionScriptBlocksIndentation = ScriptBlocksIndentation.Tabulation
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0097, flexibleScriptSyntaxEvaluator12, null, null, null)
@@ -1721,8 +1763,11 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator13 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
-                    OptionScriptBlocksIndentationNumberOfSpaces = 2
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
+                        OptionScriptBlocksIndentationNumberOfSpaces = 2
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0098, flexibleScriptSyntaxEvaluator13, null, null, null)
@@ -1730,14 +1775,17 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
                     .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Spaces))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptBlocksIndentationNumberOfSpaces))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksIndentationNumberOfSpaces))
                     .Returns(24);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator14 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
-                    OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
+                        OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
+                    },
                     OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false,
                 };
 
@@ -1747,7 +1795,7 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
                     .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Spaces))
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptEndOfExpression))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptEndOfExpression))
                     .SetCategory(nameof(ExpressionEvaluator.OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression))
                     .SetCategory("PythonSyntax")
                     .Returns(24);
@@ -1912,7 +1960,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator01 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.HeadBrackets
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.HeadBrackets
+                    }
                 };
 
                 yield return new TestCaseData(flexibleScriptSyntaxEvaluator01, Resources.Script0075.Replace("[infos]", "HeadBrackets"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
@@ -1947,7 +1998,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                    }
                 };
 
                 yield return new TestCaseData(flexibleScriptSyntaxEvaluator02, Resources.Script0079.Replace("[infos]", "SeparatorBetweenHeadAndBlock"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
@@ -1964,7 +2018,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator03 = new ExpressionEvaluator()
                 {
-                    OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
+                    }
                 };
 
                 yield return new TestCaseData(flexibleScriptSyntaxEvaluator03, Resources.Script0075.Replace("[infos]", "Both"), typeof(ExpressionEvaluatorSyntaxErrorException), null, null)
diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
index 8be7b47..8d3cb00 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
@@ -1371,7 +1371,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionFluidPrefixingActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionFluidPrefixingActive = false
+                    }
                 };
 
                 yield return new TestCaseData(evaluator, "List(1,2,3).FluidAdd(4).Count", typeof(ExpressionEvaluatorSyntaxErrorException)).SetCategory("Options").SetCategory("OptionFluidPrefixingActive");
@@ -1382,7 +1385,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionCharEvaluationActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionCharEvaluationActive = false
+                    }
                 };
 
                 yield return new TestCaseData(evaluator, "'e'", typeof(ExpressionEvaluatorSyntaxErrorException)).SetCategory("Options").SetCategory("OptionCharEvaluationActive");
@@ -1395,7 +1401,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionStringEvaluationActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionStringEvaluationActive = false
+                    }
                 };
 
                 yield return new TestCaseData(evaluator, "\"hello\"", typeof(ExpressionEvaluatorSyntaxErrorException)).SetCategory("Options").SetCategory("OptionStringEvaluationActive");
@@ -1423,7 +1432,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionNewKeywordEvaluationActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionNewKeywordEvaluationActive = false
+                    }
                 };
 
                 evaluator.Namespaces.Add(typeof(ClassForTest1).Namespace);
@@ -1439,7 +1451,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionStaticMethodsCallActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionStaticMethodsCallActive = false
+                    }
                 };
 
                 evaluator.Namespaces.Add(typeof(ClassForTest1).Namespace);
@@ -1452,7 +1467,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionStaticPropertiesGetActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionStaticPropertiesGetActive = false
+                    }
                 };
 
                 evaluator.Namespaces.Add(typeof(ClassForTest1).Namespace);
@@ -1465,7 +1483,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionInstanceMethodsCallActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionInstanceMethodsCallActive = false
+                    }
                 };
 
                 evaluator.Variables["customObject"] = new ClassForTest1();
@@ -1480,7 +1501,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionInstancePropertiesGetActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionInstancePropertiesGetActive = false
+                    }
                 };
 
                 evaluator.Variables["customObject"] = new ClassForTest1();
@@ -1495,7 +1519,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionIndexingActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        OptionIndexingActive = false
+                    }
                 };
 
                 evaluator.Variables["dict"] = new Dictionary<string, int>() { { "intValue", 5 } };
@@ -1686,7 +1713,10 @@ public static IEnumerable<TestCaseData> TestCasesEvaluateWithSpecificEvaluator
                 yield return new TestCaseData(new ExpressionEvaluator
                 {
                     OptionNumberParsingDecimalSeparator = ",",
-                    OptionFunctionArgumentsSeparator = ";"
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionFunctionArgumentsSeparator = ";"
+                    }
                 }
                 , "Max(0,5; 0,7)"
                 , null)
@@ -1698,7 +1728,10 @@ public static IEnumerable<TestCaseData> TestCasesEvaluateWithSpecificEvaluator
                 {
                     OptionNumberParsingDecimalSeparator = ",",
                     OptionNumberParsingThousandSeparator = "'",
-                    OptionFunctionArgumentsSeparator = ";"
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionFunctionArgumentsSeparator = ";"
+                    }
                 }
                 , "Max(1'200,5; 1'111'000,7)"
                 , null)
@@ -1710,7 +1743,10 @@ public static IEnumerable<TestCaseData> TestCasesEvaluateWithSpecificEvaluator
                 {
                     OptionNumberParsingDecimalSeparator = ",",
                     OptionNumberParsingThousandSeparator = "'",
-                    OptionInitializersSeparator = ";"
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        OptionInitializersSeparator = ";"
+                    }
                 }
                  , "new double[]{1'200,5; 1'111'000,7}.Max()"
                  , null)
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 5653e54..3416ce8 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -91,7 +91,7 @@ protected virtual void RefreshBlocksKeywordDetection()
                 optional = "?";
 
             if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
-                startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
+                startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionsSyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
 
             blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, CompiledRegexOptionAndIfNecessaryIgnoreCase);
             blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionsSyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
@@ -641,18 +641,25 @@ public abstract class Options
         {
             protected ExpressionEvaluator evaluator;
 
-            protected Options(ExpressionEvaluator evaluator)
+            internal void SetEvaluator(ExpressionEvaluator evaluator)
             {
                 this.evaluator = evaluator;
             }
+
+            internal virtual void Init() { }
         }
 
         #endregion
 
         #region Functionalities options
+
         public class FunctionalitiesActivation : Options
         {
-            public FunctionalitiesActivation(ExpressionEvaluator evaluator) : base(evaluator) { }
+            internal override void Init()
+            {
+                evaluator?.RefreshInstanceCreationKeywordRegexPattern();
+                evaluator?.RefreshCastRegex();
+            }
 
             /// <summary>
             /// If <c>true</c> allow to add the prefix Fluid or Fluent before void methods names to return back the instance on which the method is call<para/>
@@ -673,8 +680,8 @@ public bool OptionInlineNamespacesEvaluationActive
                 set
                 {
                     optionInlineNamespacesEvaluationActive = value;
-                    evaluator.RefreshInstanceCreationKeywordRegexPattern();
-                    evaluator.RefreshCastRegex();
+                    evaluator?.RefreshInstanceCreationKeywordRegexPattern();
+                    evaluator?.RefreshCastRegex();
                 }
             }
 
@@ -770,17 +777,43 @@ public bool OptionInlineNamespacesEvaluationActive
             public bool OptionScriptEvaluateFunctionActive { get; set; } = true;
         }
 
+        private FunctionalitiesActivation optionsFunctionalities;
         /// <summary>
         /// Options to activate or block functionalities of ExpressionEvaluator
         /// </summary>
-        public FunctionalitiesActivation OptionsFunctionalities { get; private set; }
+        public FunctionalitiesActivation OptionsFunctionalities
+        {
+            get { return optionsFunctionalities; }
+            set
+            {
+                if (value != null)
+                {
+                    optionsFunctionalities = value;
+                    optionsFunctionalities.SetEvaluator(this);
+                    optionsFunctionalities.Init();
+                }
+
+            }
+        }
 
         #endregion
 
         #region Syntax rules options
         public class SyntaxRules : Options
         {
-            public SyntaxRules(ExpressionEvaluator evaluator) : base(evaluator) { }
+            internal override void Init()
+            {
+                if (evaluator != null)
+                {
+                    evaluator.RefreshInstanceCreationKeywordRegexPattern();
+                    evaluator.RefreshEndOfExpressionDetection();
+                    evaluator.RefreshBlocksKeywordDetection();
+                    evaluator.isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
+                    evaluator.RefreshBlockStartDetection();
+                    evaluator.isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockEndBracket);
+                    evaluator.RefreshIndentedBlockDetection();
+                }
+            }
 
             private string[] keywordNew = new[] { "new" };
             /// <summary>
@@ -793,7 +826,7 @@ public string[] KeywordNew
                 set
                 {
                     keywordNew = value;
-                    evaluator.RefreshInstanceCreationKeywordRegexPattern();
+                    evaluator?.RefreshInstanceCreationKeywordRegexPattern();
                 }
             }
 
@@ -808,7 +841,7 @@ public string[] OptionScriptEndOfExpression
                 set
                 {
                     optionScriptEndOfExpression = value;
-                    evaluator.RefreshEndOfExpressionDetection();
+                    evaluator?.RefreshEndOfExpressionDetection();
                 }
             }
 
@@ -833,6 +866,21 @@ public string[] OptionScriptEndOfExpression
             /// </summary>
             public string OptionScriptBlockKeywordsHeadSubExpressionsSeparator { get; set; } = ";";
 
+            private string optionScriptBlocksKeywordsHeadStatementsStartBracket = "(";
+            /// <summary>
+            /// To specify the character or string that begin the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
+            /// <para>Default value : <c>"("</c></para>
+            /// </summary>
+            public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
+            {
+                get { return optionScriptBlocksKeywordsHeadStatementsStartBracket; }
+                set
+                {
+                    optionScriptBlocksKeywordsHeadStatementsStartBracket = value;
+                    evaluator?.RefreshBlocksKeywordDetection();
+                }
+            }
+
             /// <summary>
             /// To specify the character or string that end the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
             /// <para>Default value : <c>")"</c></para>
@@ -856,7 +904,7 @@ public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatement
                 set
                 {
                     optionScriptSyntaxForHeadStatementInBlocksKeywords = value;
-                    evaluator.RefreshBlocksKeywordDetection();
+                    evaluator?.RefreshBlocksKeywordDetection();
                 }
             }
 
@@ -871,8 +919,11 @@ public string OptionScriptBlockStartBracket
                 set
                 {
                     optionScriptBlockStartBracket = value;
-                    evaluator.isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
-                    evaluator.RefreshBlockStartDetection();
+                    if (evaluator != null)
+                    {
+                        evaluator.isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
+                        evaluator.RefreshBlockStartDetection();
+                    }
                 }
             }
 
@@ -887,7 +938,10 @@ public string OptionScriptBlockEndBracket
                 set
                 {
                     optionScriptBlockEndBracket = value;
-                    evaluator.isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockEndBracket);
+                    if (evaluator != null)
+                    {
+                        evaluator.isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockEndBracket);
+                    }
                 }
             }
 
@@ -910,7 +964,7 @@ public ScriptBlocksIndentation OptionScriptBlocksIndentation
                 set
                 {
                     optionScriptBlocksIndentation = value;
-                    evaluator.RefreshIndentedBlockDetection();
+                    evaluator?.RefreshIndentedBlockDetection();
                 }
             }
 
@@ -928,15 +982,28 @@ public int OptionScriptBlocksIndentationNumberOfSpaces
                 set
                 {
                     optionScriptBlocksIndentationNumberOfSpaces = value;
-                    evaluator.RefreshIndentedBlockDetection();
+                    evaluator?.RefreshIndentedBlockDetection();
                 }
             }
         }
 
+        private SyntaxRules optionsSyntaxRules;
         /// <summary>
         /// Options to modify specific tokens/keywords/syntax parsing.
         /// </summary>
-        public SyntaxRules OptionsSyntaxRules { get; private set; }
+        public SyntaxRules OptionsSyntaxRules
+        {
+            get { return optionsSyntaxRules; }
+            set
+            {
+                if (value != null)
+                {
+                    optionsSyntaxRules = value;
+                    optionsSyntaxRules.SetEvaluator(this);
+                    optionsSyntaxRules.Init();
+                }
+            }
+        }
 
         #endregion
 
@@ -1104,21 +1171,6 @@ public bool OptionNewFunctionEvaluationActive
         /// </summary>
         public bool OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression { get; set; } = true;
 
-        private string optionScriptBlocksKeywordsHeadStatementsStartBracket = "(";
-        /// <summary>
-        /// To specify the character or string that begin the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
-        /// <para>Default value : <c>"("</c></para>
-        /// </summary>
-        public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
-        {
-            get { return optionScriptBlocksKeywordsHeadStatementsStartBracket; }
-            set
-            {
-                optionScriptBlocksKeywordsHeadStatementsStartBracket = value;
-                RefreshBlocksKeywordDetection();
-            }
-        }
-
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)<para/>
         /// If <c>false</c> Allow access only to public members.
@@ -1299,8 +1351,8 @@ protected virtual void OptionsInit()
             numberRegexPattern = string.Format(numberRegexOrigPattern, @"\.", string.Empty);
             CultureInfoForNumberParsing.NumberFormat.NumberDecimalSeparator = ".";
 
-            OptionsFunctionalities = new FunctionalitiesActivation(this);
-            OptionsSyntaxRules = new SyntaxRules(this);
+            (optionsFunctionalities = new FunctionalitiesActivation()).SetEvaluator(this);
+            (optionsSyntaxRules = new SyntaxRules()).SetEvaluator(this);
         }
 
         protected virtual void Init()
@@ -1402,7 +1454,7 @@ void ExecuteBlocksStacks()
                         }
                         else
                         {
-                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadSubExpressionsSeparator, OptionScriptBlocksKeywordsHeadStatementsStartBracket, OptionsSyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket);
+                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadSubExpressionsSeparator, OptionsSyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket, OptionsSyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket);
 
                             if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.HeadBrackets)
                             {

From 2ef9eb7b4c3858ea12ec1f29c0d42540bd915d6c Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 19 May 2021 21:39:51 +0200
Subject: [PATCH 36/48] Options refactoring step 2

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs | 159 ++++----
 .../ExpressionEvaluatorTests.cs               |  33 +-
 .../ExpressionEvaluator.cs                    | 376 +++++++++---------
 TryWindow/MainWindow.xaml.cs                  |   5 +-
 4 files changed, 301 insertions(+), 272 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 640d9ca..7fbe856 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1165,7 +1165,10 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
 
                 ExpressionEvaluator evaluatorForNoSemicolonAtTheEnd = new ExpressionEvaluator()
                 {
-                    OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        MandatoryLastStatementTerminalPunctuator = false
+                    }
                 };
 
                 yield return new TestCaseData(Resources.Script0061, evaluatorForNoSemicolonAtTheEnd, null, null, null)
@@ -1435,23 +1438,23 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
+                        StatementTerminalPunctuators = new string[] { "\r\n", "\r", "\n" },
+                        MandatoryLastStatementTerminalPunctuator = false
                     },
-                    OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false
                 };
 
                 yield return new TestCaseData(Resources.Script0074, flexibleScriptSyntaxEvaluator01, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptEndOfExpression))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.StatementTerminalPunctuators))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.MandatoryLastStatementTerminalPunctuator))
                     .Returns(8);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator02 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
                     }
                 };
 
@@ -1489,7 +1492,7 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Any
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Any
                     }
                 };
 
@@ -1539,7 +1542,7 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
                     }
                 };
 
@@ -1565,77 +1568,77 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptBlocksKeywordsHeadStatementsStartBracket = "|",
-                        OptionScriptBlocksKeywordsHeadExpressionEndBracket = "|"
+                        BlocksKeywordsHeadStatementsStartBracket = "|",
+                        BlocksKeywordsHeadExpressionEndBracket = "|"
                     }
                 };
 
                 yield return new TestCaseData(Resources.Script0082, flexibleScriptSyntaxEvaluator05, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0083, flexibleScriptSyntaxEvaluator05, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator06 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptBlocksKeywordsHeadStatementsStartBracket = "{",
-                        OptionScriptBlocksKeywordsHeadExpressionEndBracket = "}"
+                        BlocksKeywordsHeadStatementsStartBracket = "{",
+                        BlocksKeywordsHeadExpressionEndBracket = "}"
                     }
                 };
 
                 yield return new TestCaseData(Resources.Script0084, flexibleScriptSyntaxEvaluator06, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0085, flexibleScriptSyntaxEvaluator06, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator07 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptBlocksKeywordsHeadStatementsStartBracket = "<[",
-                        OptionScriptBlocksKeywordsHeadExpressionEndBracket = "]>"
+                        BlocksKeywordsHeadStatementsStartBracket = "<[",
+                        BlocksKeywordsHeadExpressionEndBracket = "]>"
                     }
                 };
 
                 yield return new TestCaseData(Resources.Script0086, flexibleScriptSyntaxEvaluator07, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0087, flexibleScriptSyntaxEvaluator07, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadStatementsStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlocksKeywordsHeadExpressionEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator08 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator = "=>",
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                        BlockKeywordsHeadExpressionAndBlockSeparator = "=>",
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
                     }
                 };
 
@@ -1643,40 +1646,40 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockKeywordsHeadExpressionAndBlockSeparator))
                     .Returns(20);
 
                 yield return new TestCaseData(Resources.Script0089, flexibleScriptSyntaxEvaluator08, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockKeywordsHeadExpressionAndBlockSeparator))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator09 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptBlockStartBracket = "(",
-                        OptionScriptBlockEndBracket = ")"
+                        BlockStartBracket = "(",
+                        BlockEndBracket = ")"
                     }
                 };
 
                 yield return new TestCaseData(Resources.Script0090, flexibleScriptSyntaxEvaluator09, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockEndBracket))
                     .Returns(20);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator10 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
-                        OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator = "then",
-                        OptionScriptBlockStartBracket = "begin",
-                        OptionScriptBlockEndBracket = "end"
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
+                        BlockKeywordsHeadExpressionAndBlockSeparator = "then",
+                        BlockStartBracket = "begin",
+                        BlockEndBracket = "end"
                     }
                 };
 
@@ -1685,9 +1688,9 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0091, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockEndBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockKeywordsHeadExpressionAndBlockSeparator))
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
@@ -1695,9 +1698,9 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0092, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockEndBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockKeywordsHeadExpressionAndBlockSeparator))
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
@@ -1705,9 +1708,9 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 yield return new TestCaseData(Resources.Script0093, flexibleScriptSyntaxEvaluator10, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockStartBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockEndBracket))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockStartBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockEndBracket))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockKeywordsHeadExpressionAndBlockSeparator))
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
                     .SetCategory("PascalSyntax")
                     .Returns(20);
@@ -1734,69 +1737,69 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation
+                        SyntaxForBlockIdentifier = SyntaxForBlockIdentifier.Indentation
                     }
                 };
 
                 yield return new TestCaseData(Resources.Script0096, flexibleScriptSyntaxEvaluator11, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
-                    .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Spaces))
+                    .SetCategory(nameof(SyntaxForBlockIdentifier.Indentation))
+                    .SetCategory("Indentation : " + nameof(BlockIndentation.Spaces))
                     .Returns(24);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator12 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
-                        OptionScriptBlocksIndentation = ScriptBlocksIndentation.Tabulation
+                        SyntaxForBlockIdentifier = SyntaxForBlockIdentifier.Indentation,
+                        BlockIndentation = BlockIndentation.Tabulation
                     }
                 };
 
                 yield return new TestCaseData(Resources.Script0097, flexibleScriptSyntaxEvaluator12, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
-                    .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Tabulation))
+                    .SetCategory(nameof(SyntaxForBlockIdentifier.Indentation))
+                    .SetCategory("Indentation : " + nameof(BlockIndentation.Tabulation))
                     .Returns(24);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator13 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
-                        OptionScriptBlocksIndentationNumberOfSpaces = 2
+                        SyntaxForBlockIdentifier = SyntaxForBlockIdentifier.Indentation,
+                        BlockIndentationNumberOfSpaces = 2
                     }
                 };
 
                 yield return new TestCaseData(Resources.Script0098, flexibleScriptSyntaxEvaluator13, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
-                    .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Spaces))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptBlocksIndentationNumberOfSpaces))
+                    .SetCategory(nameof(SyntaxForBlockIdentifier.Indentation))
+                    .SetCategory("Indentation : " + nameof(BlockIndentation.Spaces))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.BlockIndentationNumberOfSpaces))
                     .Returns(24);
 
                 ExpressionEvaluator flexibleScriptSyntaxEvaluator14 = new ExpressionEvaluator()
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation,
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
-                        OptionScriptEndOfExpression = new string[] { "\r\n", "\r", "\n" },
+                        SyntaxForBlockIdentifier = SyntaxForBlockIdentifier.Indentation,
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock,
+                        StatementTerminalPunctuators = new string[] { "\r\n", "\r", "\n" },
+                        MandatoryLastStatementTerminalPunctuator = false,
                     },
-                    OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false,
                 };
 
                 yield return new TestCaseData(Resources.Script0099, flexibleScriptSyntaxEvaluator14, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("FlexibleScriptSyntax")
-                    .SetCategory(nameof(SyntaxForScriptBlocksIdentifier.Indentation))
-                    .SetCategory("Indentation : " + nameof(ScriptBlocksIndentation.Spaces))
+                    .SetCategory(nameof(SyntaxForBlockIdentifier.Indentation))
+                    .SetCategory("Indentation : " + nameof(BlockIndentation.Spaces))
                     .SetCategory(nameof(SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock))
-                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.OptionScriptEndOfExpression))
-                    .SetCategory(nameof(ExpressionEvaluator.OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.StatementTerminalPunctuators))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.MandatoryLastStatementTerminalPunctuator))
                     .SetCategory("PythonSyntax")
                     .Returns(24);
 
@@ -1871,7 +1874,13 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("Better Than C#")
                     .Returns("Result Hey 9, 5");
 
-                yield return new TestCaseData(Resources.Script0066, new ExpressionEvaluator { OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false }, null, null, null)
+                yield return new TestCaseData(Resources.Script0066, new ExpressionEvaluator
+                {
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        MandatoryLastStatementTerminalPunctuator = false
+                    }
+                }, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("primaryTyped variable")
                     .SetCategory("string")
@@ -1882,7 +1891,13 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("OptionScriptNeedSemicolonAtTheEndOfLastExpression")
                     .Returns("0,1,2,3,4,");
 
-                yield return new TestCaseData(Resources.Script0070, new ExpressionEvaluator { OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = false }, null, null, null)
+                yield return new TestCaseData(Resources.Script0070, new ExpressionEvaluator
+                {
+                    OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                    {
+                        MandatoryLastStatementTerminalPunctuator = false
+                    }
+                }, null, null, null)
                     .SetCategory("Script")
                     .SetCategory("new Exception must not throw the exception")
                     .Returns(3);
@@ -1962,7 +1977,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.HeadBrackets
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.HeadBrackets
                     }
                 };
 
@@ -2000,7 +2015,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
                     }
                 };
 
@@ -2020,7 +2035,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingScriptEvalu
                 {
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionScriptSyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
+                        SyntaxForHeadStatementInBlocksKeywords = SyntaxForHeadStatementInBlocksKeywords.Both
                     }
                 };
 
diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
index d923f0b..54df190 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
@@ -1373,7 +1373,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionFluidPrefixingActive = false
+                        FluidPrefixingActive = false
                     }
                 };
 
@@ -1387,7 +1387,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionCharEvaluationActive = false
+                        CharEvaluationActive = false
                     }
                 };
 
@@ -1403,7 +1403,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionStringEvaluationActive = false
+                        StringEvaluationActive = false
                     }
                 };
 
@@ -1417,7 +1417,10 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
 
                 evaluator = new ExpressionEvaluator()
                 {
-                    OptionNewFunctionEvaluationActive = false
+                    OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
+                    {
+                        NewFunctionEvaluationActive = false
+                    }
                 };
 
                 evaluator.Namespaces.Add(typeof(ClassForTest1).Namespace);
@@ -1434,7 +1437,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionNewKeywordEvaluationActive = false
+                        NewKeywordEvaluationActive = false
                     }
                 };
 
@@ -1453,7 +1456,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionStaticMethodsCallActive = false
+                        StaticMethodsCallActive = false
                     }
                 };
 
@@ -1469,7 +1472,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionStaticPropertiesGetActive = false
+                        StaticPropertiesGetActive = false
                     }
                 };
 
@@ -1485,7 +1488,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionInstanceMethodsCallActive = false
+                        InstanceMethodsCallActive = false
                     }
                 };
 
@@ -1503,7 +1506,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionInstancePropertiesGetActive = false
+                        InstancePropertiesGetActive = false
                     }
                 };
 
@@ -1521,7 +1524,7 @@ public static IEnumerable<TestCaseData> TestCasesForExceptionThrowingEvaluation
                 {
                     OptionsFunctionalities = new ExpressionEvaluator.FunctionalitiesActivation()
                     {
-                        OptionIndexingActive = false
+                        IndexingActive = false
                     }
                 };
 
@@ -1715,7 +1718,7 @@ public static IEnumerable<TestCaseData> TestCasesEvaluateWithSpecificEvaluator
                     OptionNumberParsingDecimalSeparator = ",",
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionFunctionArgumentsSeparator = ";"
+                        FunctionArgumentsSeparator = ";"
                     }
                 }
                 , "Max(0,5; 0,7)"
@@ -1730,7 +1733,7 @@ public static IEnumerable<TestCaseData> TestCasesEvaluateWithSpecificEvaluator
                     OptionNumberParsingThousandSeparator = "'",
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionFunctionArgumentsSeparator = ";"
+                        FunctionArgumentsSeparator = ";"
                     }
                 }
                 , "Max(1'200,5; 1'111'000,7)"
@@ -1745,7 +1748,7 @@ public static IEnumerable<TestCaseData> TestCasesEvaluateWithSpecificEvaluator
                     OptionNumberParsingThousandSeparator = "'",
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        OptionInitializersSeparator = ";"
+                        InitializersSeparator = ";"
                     }
                 }
                  , "new double[]{1'200,5; 1'111'000,7}.Max()"
@@ -2676,7 +2679,7 @@ ExpressionEvaluator evaluatorForMethodArgs()
 
                 #endregion
 
-                #region for issue #100 Array types in cast or typeof generate an exception
+                #region For issue #100 Array types in cast or typeof generate an exception
 
                 yield return new TestCaseData(new ExpressionEvaluator()
                     , "typeof(double[])"
@@ -2737,7 +2740,7 @@ ExpressionEvaluator evaluatorForMethodArgs()
 
                 #endregion
 
-                #region For multidimensional indexing
+                #region For issue #102 multidimensional indexing
 
                 yield return new TestCaseData(new ExpressionEvaluator(new Dictionary<string, object> { { "doubleIndexObject", new ClassForIndexing() } })
                     , "doubleIndexObject[2,3]"
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 624e316..62b23f6 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -78,7 +78,7 @@ public partial class ExpressionEvaluator
         protected Regex blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>[{])", RegexOptions.Compiled);
         protected Regex blockIndentationRegex = new Regex(@"^([\r\n]*(([ ]{4})+.*)([\r\n]|$)+)+", RegexOptions.Compiled);
         protected Regex blockIndentationLevelTrimRegex = new Regex("^[ ]{4}", RegexOptions.Compiled | RegexOptions.Multiline);
-        protected Regex nextIsEndOfExpressionRegex = new Regex("^(;)", RegexOptions.Compiled);
+        protected Regex nextIsStatementTerminalPunctuatorRegex = new Regex("^(;)", RegexOptions.Compiled);
         protected static readonly Regex wordTypeTokenDetectionRegex = new Regex(@"^(?>[\p{L}_0-9]+)$", RegexOptions.Compiled);
         protected static readonly Regex wordTypeTokenBoundaryValidation = new Regex(@"[^\p{L}_0-9.]", RegexOptions.Compiled);
         protected static readonly Regex foreachParenthisEvaluationRegex = new Regex(@"^(?>\s*)(?<variableName>[\p{L}_](?>[\p{L}_0-9]*))(?>\s*)(?<in>in)(?>\s*)(?<collection>.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
@@ -93,42 +93,42 @@ protected virtual void RefreshBlocksKeywordDetection()
             string optional = string.Empty;
             string startBracketDetection = string.Empty;
 
-             if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any)
+             if (OptionsSyntaxRules.SyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any)
                 optional = "?";
 
-            if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
-                startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionsSyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket)})" + optional;
+            if (OptionsSyntaxRules.SyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock)
+                startBracketDetection = $"(?<startBracket>{Regex.Escape(OptionsSyntaxRules.BlocksKeywordsHeadStatementsStartBracket)})" + optional;
 
             blockKeywordsBeginningRegex = new Regex(@"^(?>\s*)(?<keyword>while|for|foreach|if|else(?>\s*)if|catch)(?>\s*)" + startBracketDetection, CompiledRegexOptionAndIfNecessaryIgnoreCase);
-            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionsSyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            blockKeywordsHeadAndBodySeparatorRegex = new Regex(@"^(?>\s*)(?<Separator>" + Regex.Escape(OptionsSyntaxRules.BlockKeywordsHeadExpressionAndBlockSeparator) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshBlockStartDetection()
         {
-            blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionsSyntaxRules.OptionScriptBlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            blockBeginningRegex = new Regex(@"^(?>\s*)(?<startBracket>" + Regex.Escape(OptionsSyntaxRules.BlockStartBracket) + ")", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshIndentedBlockDetection()
         {
-            string indentRegexPattern = OptionsSyntaxRules.OptionScriptBlocksIndentation == ScriptBlocksIndentation.Tabulation ? @"\t" : "[ ]{" + OptionsSyntaxRules.OptionScriptBlocksIndentationNumberOfSpaces + "}";
+            string indentRegexPattern = OptionsSyntaxRules.BlockIndentation == BlockIndentation.Tabulation ? @"\t" : "[ ]{" + OptionsSyntaxRules.BlockIndentationNumberOfSpaces + "}";
 
             blockIndentationRegex = new Regex(@"^([\r\n]*((" + indentRegexPattern + @")+.*)([\r\n]|$)+)+", RegexOptions.Compiled);
             blockIndentationLevelTrimRegex = new Regex("^" + indentRegexPattern, RegexOptions.Compiled | RegexOptions.Multiline);
         }
 
-        protected virtual void RefreshEndOfExpressionDetection()
+        protected virtual void RefreshStatementTerminalPunctuatorDetection()
         {
-            nextIsEndOfExpressionRegex = new Regex($"^({string.Join("|", OptionsSyntaxRules.OptionScriptEndOfExpression.Select(o => Regex.Escape(o)))})", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            nextIsStatementTerminalPunctuatorRegex = new Regex($"^({string.Join("|", OptionsSyntaxRules.StatementTerminalPunctuators.Select(o => Regex.Escape(o)))})", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshInstanceCreationKeywordRegexPattern()
         {
-            instanceCreationKeywordRegex = new Regex("^(" + string.Join("|", OptionsSyntaxRules.KeywordNew.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionsFunctionalities.OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            instanceCreationKeywordRegex = new Regex("^(" + string.Join("|", OptionsSyntaxRules.KeywordNew.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionsFunctionalities.InlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshCastRegex()
         {
-            castRegex = new Regex(@"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9" + (OptionsFunctionalities.OptionInlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"\[\]<>]*[?]?)(?>\s*)\)", RegexOptions.Compiled);
+            castRegex = new Regex(@"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9" + (OptionsFunctionalities.InlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"\[\]<>]*[?]?)(?>\s*)\)", RegexOptions.Compiled);
         }
 
         protected RegexOptions CompiledRegexOptionAndIfNecessaryIgnoreCase => OptionCaseSensitiveEvaluationActive ? RegexOptions.Compiled : RegexOptions.IgnoreCase | RegexOptions.Compiled;
@@ -623,12 +623,15 @@ internal virtual void Init() { }
 
         #region Functionalities options
 
+        private Func<ExpressionEvaluator, List<string>, object> newMethodMem;
+
         public class FunctionalitiesActivation : Options
         {
             internal override void Init()
             {
                 evaluator?.RefreshInstanceCreationKeywordRegexPattern();
                 evaluator?.RefreshCastRegex();
+                NewFunctionEvaluationActive = tempInitNewFunctionEvaluationActive;
             }
 
             /// <summary>
@@ -636,20 +639,20 @@ internal override void Init()
             /// If <c>false</c> unactive this functionality
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionFluidPrefixingActive { get; set; } = true;
+            public bool FluidPrefixingActive { get; set; } = true;
 
-            private bool optionInlineNamespacesEvaluationActive = true;
+            private bool inlineNamespacesEvaluationActive = true;
             /// <summary>
             /// If <c>true</c> allow the use of inline namespace (Can be slow, and is less secure)<para/>
             /// If <c>false</c> unactive inline namespace (only namespaces in Namespaces list are available)
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionInlineNamespacesEvaluationActive
+            public bool InlineNamespacesEvaluationActive
             {
-                get { return optionInlineNamespacesEvaluationActive; }
+                get { return inlineNamespacesEvaluationActive; }
                 set
                 {
-                    optionInlineNamespacesEvaluationActive = value;
+                    inlineNamespacesEvaluationActive = value;
                     evaluator?.RefreshInstanceCreationKeywordRegexPattern();
                     evaluator?.RefreshCastRegex();
                 }
@@ -660,91 +663,121 @@ public bool OptionInlineNamespacesEvaluationActive
             /// If <c>false</c> unactive this functionality.
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionNewKeywordEvaluationActive { get; set; } = true;
+            public bool NewKeywordEvaluationActive { get; set; } = true;
+
+            private bool tempInitNewFunctionEvaluationActive = true;
+            /// <summary>
+            /// If <c>true</c> allow to create instance of object with the Default function new(ClassNam,...)<para/>
+            /// If <c>false</c> unactive this functionality.
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool NewFunctionEvaluationActive
+            {
+                get
+                {
+                    return evaluator?.complexStandardFuncsDictionary.ContainsKey("new") != false;
+                }
+                set
+                {
+                    if (evaluator == null)
+                    {
+                        tempInitNewFunctionEvaluationActive = value;
+                    }
+                    else if (value && !evaluator.complexStandardFuncsDictionary.ContainsKey("new"))
+                    {
+                        evaluator.complexStandardFuncsDictionary["new"] = evaluator.newMethodMem;
+                    }
+                    else if (!value && evaluator.complexStandardFuncsDictionary.ContainsKey("new"))
+                    {
+                        evaluator.newMethodMem = evaluator.complexStandardFuncsDictionary["new"];
+                        evaluator.complexStandardFuncsDictionary.Remove("new");
+                    }
+                }
+            }
 
             /// <summary>
             /// If <c>true</c> allow to call static methods on classes.<para/>
             /// If <c>false</c> unactive this functionality.
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionStaticMethodsCallActive { get; set; } = true;
+            public bool StaticMethodsCallActive { get; set; } = true;
 
             /// <summary>
             /// If <c>true</c> allow to get static properties on classes<para/>
             /// If <c>false</c> unactive this functionality
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionStaticPropertiesGetActive { get; set; } = true;
+            public bool StaticPropertiesGetActive { get; set; } = true;
 
             /// <summary>
             /// If <c>true</c> allow to call instance methods on objects<para/>
             /// If <c>false</c> unactive this functionality
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionInstanceMethodsCallActive { get; set; } = true;
+            public bool InstanceMethodsCallActive { get; set; } = true;
 
             /// <summary>
             /// If <c>true</c> allow to get instance properties on objects<para/>
             /// If <c>false</c> unactive this functionality.
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionInstancePropertiesGetActive { get; set; } = true;
+            public bool InstancePropertiesGetActive { get; set; } = true;
 
             /// <summary>
             /// If <c>true</c> allow to get object at index or key like IndexedObject[indexOrKey]<para/>
             /// If <c>false</c> unactive this functionality.
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionIndexingActive { get; set; } = true;
+            public bool IndexingActive { get; set; } = true;
 
             /// <summary>
             /// If <c>true</c> allow string interpretation with ""<para/>
             /// If <c>false</c> unactive this functionality
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionStringEvaluationActive { get; set; } = true;
+            public bool StringEvaluationActive { get; set; } = true;
 
             /// <summary>
             /// If <c>true</c> allow char interpretation with ''<para/>
             /// If <c>false</c> unactive this functionality
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionCharEvaluationActive { get; set; } = true;
+            public bool CharEvaluationActive { get; set; } = true;
 
             /// <summary>
             /// If <c>true</c> Evaluate function is callables in an expression. If <c>false</c> Evaluate is not callable<para/>
             /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionEvaluateFunctionActive { get; set; } = true;
+            public bool EvaluateFunctionActive { get; set; } = true;
 
             /// <summary>
-            /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
-            /// If <c>false</c> unactive this functionality
+            /// If <c>true</c> ScriptEvaluate function is callables in an expression. If <c>false</c> Evaluate is not callable.
             /// <para>Default value : <c>true</c></para>
+            /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
             /// </summary>
-            public bool OptionVariableAssignationActive { get; set; } = true;
+            public bool ScriptEvaluateFunctionActive { get; set; } = true;
 
             /// <summary>
-            /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
+            /// If <c>true</c> allow to assign a value to a variable in the Variable disctionary with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
             /// If <c>false</c> unactive this functionality
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionPropertyOrFieldSetActive { get; set; } = true;
+            public bool VariableAssignationActive { get; set; } = true;
 
             /// <summary>
-            /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
+            /// If <c>true</c> allow to set/modify a property or a field value with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
             /// If <c>false</c> unactive this functionality
             /// <para>Default value : <c>true</c></para>
             /// </summary>
-            public bool OptionIndexingAssignationActive { get; set; } = true;
+            public bool PropertyOrFieldSetActive { get; set; } = true;
 
             /// <summary>
-            /// If <c>true</c> ScriptEvaluate function is callables in an expression. If <c>false</c> Evaluate is not callable.
+            /// If <c>true</c> allow to assign a indexed element like Collections, List, Arrays and Dictionaries with (=, +=, -=, *=, /=, %=, &amp;=, |=, ^=, &lt;&lt;=, &gt;&gt;=, ??=, ++ or --)<para/>
+            /// If <c>false</c> unactive this functionality
             /// <para>Default value : <c>true</c></para>
-            /// If set to false for security (also ensure that ExpressionEvaluator type is in TypesToBlock list)
             /// </summary>
-            public bool OptionScriptEvaluateFunctionActive { get; set; } = true;
+            public bool IndexingAssignationActive { get; set; } = true;
         }
 
         private FunctionalitiesActivation optionsFunctionalities;
@@ -768,6 +801,10 @@ public FunctionalitiesActivation OptionsFunctionalities
         #endregion
 
         #region Syntax rules options
+
+        protected bool isBlockStartBracketAWord;
+        protected bool isBlockEndBracketAWord;
+
         public class SyntaxRules : Options
         {
             internal override void Init()
@@ -775,11 +812,11 @@ internal override void Init()
                 if (evaluator != null)
                 {
                     evaluator.RefreshInstanceCreationKeywordRegexPattern();
-                    evaluator.RefreshEndOfExpressionDetection();
+                    evaluator.RefreshStatementTerminalPunctuatorDetection();
                     evaluator.RefreshBlocksKeywordDetection();
-                    evaluator.isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
+                    evaluator.isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(blockStartBracket);
                     evaluator.RefreshBlockStartDetection();
-                    evaluator.isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockEndBracket);
+                    evaluator.isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(blockEndBracket);
                     evaluator.RefreshIndentedBlockDetection();
                 }
             }
@@ -799,53 +836,67 @@ public string[] KeywordNew
                 }
             }
 
-            private string[] optionScriptEndOfExpression = new[] { ";" };
+            private string[] statementTerminalPunctuators = new[] { ";" };
             /// <summary>
-            /// An array of string that are used to separate expressions in script
+            /// An array of string that are used to separate expressions (statements) in script
             /// <para>Default value : <c>{";"}</c></para>
             /// </summary>
-            public string[] OptionScriptEndOfExpression
+            public string[] StatementTerminalPunctuators
             {
-                get { return optionScriptEndOfExpression; }
+                get { return statementTerminalPunctuators; }
                 set
                 {
-                    optionScriptEndOfExpression = value;
-                    evaluator?.RefreshEndOfExpressionDetection();
+                    statementTerminalPunctuators = value;
+                    evaluator?.RefreshStatementTerminalPunctuatorDetection();
                 }
             }
 
+            /// <summary>
+            /// Specify to skip the evaluation of an empty expression in scripts otherwise it will throw an exception.
+            /// For example when two semicolon <c>;;</c> are present or when there are empty line with StatementTerminalPunctuators set to end of line characters <c>{ "\r\n", "\r", "\n" }</c>
+            /// <para>Default value : <c>true;</c></para>
+            /// </summary>
+            public bool SkipEmptyExpressions { get; set; } = true;
+
+            /// <summary>
+            /// If <c>true</c> ScriptEvaluate need to have a semicolon [;] or the specified text in StatementTerminalPunctuator after each expression.<para/>
+            /// If <c>false</c> Allow to omit the OptionsSyntaxRules.StatementTerminalPunctuator for the last expression of the script.
+            /// <para>Default value : <c>true</c></para>
+            /// </summary>
+            public bool MandatoryLastStatementTerminalPunctuator { get; set; } = true;
+
             /// <summary>
             /// Allow to change the separator of functions arguments.
             /// <para>Default value : <c>","</c></para>
             /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
             /// </summary>
-            public string OptionFunctionArgumentsSeparator { get; set; } = ",";
+            public string FunctionArgumentsSeparator { get; set; } = ",";
 
             /// <summary>
             /// Allow to change the separator of Object and collections Initialization between { and } after the keyword new.
             /// <para>Default value : <c>","</c></para>
             /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
             /// </summary>
-            public string OptionInitializersSeparator { get; set; } = ",";
+            public string InitializersSeparator { get; set; } = ",";
 
             /// <summary>
             /// The separator that separate each expression in block keyword's head
             /// <para>Default value : <c>";"</c></para>
             /// <example>Example : <code>for(int i = 0; i &lt; 10; i++)</code></example>
             /// </summary>
-            public string OptionScriptBlockKeywordsHeadSubExpressionsSeparator { get; set; } = ";";
+            public string BlocksKeywordsHeadSubExpressionsSeparator { get; set; } = ";";
 
-            private string optionScriptBlocksKeywordsHeadStatementsStartBracket = "(";
+            private string blocksKeywordsHeadStatementsStartBracket = "(";
             /// <summary>
             /// To specify the character or string that begin the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
             /// <para>Default value : <c>"("</c></para>
             /// </summary>
-            public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
+            public string BlocksKeywordsHeadStatementsStartBracket
             {
-                get { return optionScriptBlocksKeywordsHeadStatementsStartBracket; }
+                get { return blocksKeywordsHeadStatementsStartBracket; }
                 set
                 {
-                    optionScriptBlocksKeywordsHeadStatementsStartBracket = value;
+                    blocksKeywordsHeadStatementsStartBracket = value;
                     evaluator?.RefreshBlocksKeywordDetection();
                 }
             }
@@ -854,62 +905,62 @@ public string OptionScriptBlocksKeywordsHeadStatementsStartBracket
             /// To specify the character or string that end the head statements of script blocks keywords (if, else if, for, foreach while, do.. while)
             /// <para>Default value : <c>")"</c></para>
             /// </summary>
-            public string OptionScriptBlocksKeywordsHeadExpressionEndBracket { get; set; } = ")";
+            public string BlocksKeywordsHeadExpressionEndBracket { get; set; } = ")";
 
             /// <summary>
             /// To specify the character or string that separate the head statements and the block statements of script blocks keywords (if, else if, for, foreach while, do.. while)
             /// <para>Default value : <c>":"</c></para>
             /// </summary>
-            public string OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator { get; set; } = ":";
+            public string BlockKeywordsHeadExpressionAndBlockSeparator { get; set; } = ":";
 
-            private SyntaxForHeadStatementInBlocksKeywords optionScriptSyntaxForHeadStatementInBlocksKeywords;
+            private SyntaxForHeadStatementInBlocksKeywords syntaxForHeadStatementInBlocksKeywords;
             /// <summary>
             /// Specify how to detect the separation between head expression and the block of code is made in script block keyword (if, else if, for, foreach while, do.. while)
             /// <para>Default value : <c>HeadBrackets</c></para>
             /// </summary>
-            public SyntaxForHeadStatementInBlocksKeywords OptionScriptSyntaxForHeadStatementInBlocksKeywords
+            public SyntaxForHeadStatementInBlocksKeywords SyntaxForHeadStatementInBlocksKeywords
             {
-                get { return optionScriptSyntaxForHeadStatementInBlocksKeywords; }
+                get { return syntaxForHeadStatementInBlocksKeywords; }
                 set
                 {
-                    optionScriptSyntaxForHeadStatementInBlocksKeywords = value;
+                    syntaxForHeadStatementInBlocksKeywords = value;
                     evaluator?.RefreshBlocksKeywordDetection();
                 }
             }
 
-            private string optionScriptBlockStartBracket = "{";
+            private string blockStartBracket = "{";
             /// <summary>
             /// To specify the character or string that start a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
             /// <para>Default value : <c>"{"</c></para>
             /// </summary>
-            public string OptionScriptBlockStartBracket
+            public string BlockStartBracket
             {
-                get { return optionScriptBlockStartBracket; }
+                get { return blockStartBracket; }
                 set
                 {
-                    optionScriptBlockStartBracket = value;
+                    blockStartBracket = value;
                     if (evaluator != null)
                     {
-                        evaluator.isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockStartBracket);
+                        evaluator.isBlockStartBracketAWord = wordTypeTokenDetectionRegex.IsMatch(blockStartBracket);
                         evaluator.RefreshBlockStartDetection();
                     }
                 }
             }
 
-            private string optionScriptBlockEndBracket = "}";
+            private string blockEndBracket = "}";
             /// <summary>
             /// To specify the character or string that end a block of code used in script blocks keywords (if, else if, for, foreach while, do.. while) and multiline lambda.
             /// <para>Default value : <c>"}"</c></para>
             /// </summary>
-            public string OptionScriptBlockEndBracket
+            public string BlockEndBracket
             {
-                get { return optionScriptBlockEndBracket; }
+                get { return blockEndBracket; }
                 set
                 {
-                    optionScriptBlockEndBracket = value;
+                    blockEndBracket = value;
                     if (evaluator != null)
                     {
-                        evaluator.isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(optionScriptBlockEndBracket);
+                        evaluator.isBlockEndBracketAWord = wordTypeTokenDetectionRegex.IsMatch(blockEndBracket);
                     }
                 }
             }
@@ -918,39 +969,39 @@ public string OptionScriptBlockEndBracket
             /// Specify the syntax to use to detect a block of code in script blocks keywords  (if, else if, for, foreach while, do.. while) and multiline lambda
             /// <para>Default value : <c>OptionalBracketsForStartAndEndWhenSingleStatement</c></para>
             /// </summary>
-            public SyntaxForScriptBlocksIdentifier OptionScriptSyntaxForBlocksIdentifier { get; set; }
+            public SyntaxForBlockIdentifier SyntaxForBlockIdentifier { get; set; }
 
-            private ScriptBlocksIndentation optionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces;
+            private BlockIndentation blockIndentation = BlockIndentation.Spaces;
             /// <summary>
             /// Specify the kind of indentation to use when :<para/>
-            /// <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c>
-            /// <para>When Set to Spaces ensure to set also <c>OptionScriptBlocksIndentationNumberOfSpaces</c></para>
-            /// <para>Default value : <c>ScriptBlocksIndentation.Spaces</c></para>
+            /// <c>SyntaxForBlockIdentifier = SyntaxForBlockIdentifier.Indentation</c>
+            /// <para>When Set to Spaces ensure to set also <c>BlockIndentationNumberOfSpaces</c></para>
+            /// <para>Default value : <c>BlockIndentation.Spaces</c></para>
             /// </summary>
-            public ScriptBlocksIndentation OptionScriptBlocksIndentation
+            public BlockIndentation BlockIndentation
             {
-                get { return optionScriptBlocksIndentation; }
+                get { return blockIndentation; }
                 set
                 {
-                    optionScriptBlocksIndentation = value;
+                    blockIndentation = value;
                     evaluator?.RefreshIndentedBlockDetection();
                 }
             }
 
-            private int optionScriptBlocksIndentationNumberOfSpaces = 4;
+            private int blockIndentationNumberOfSpaces = 4;
             /// <summary>
             /// Set the number of spaces to use as an indentation when : <para/>
-            /// <c>OptionScriptSyntaxForBlocksIdentifier = SyntaxForScriptBlocksIdentifier.Indentation</c><para/>
+            /// <c>SyntaxForBlockIdentifier = SyntaxForBlockIdentifier.Indentation</c><para/>
             /// and<para/>
-            /// <c>OptionScriptBlocksIndentation = ScriptBlocksIndentation.Spaces</c>
+            /// <c>BlockIndentation = BlockIndentation.Spaces</c>
             /// <para>Default value : <c>4</c></para>
             /// </summary>
-            public int OptionScriptBlocksIndentationNumberOfSpaces
+            public int BlockIndentationNumberOfSpaces
             {
-                get { return optionScriptBlocksIndentationNumberOfSpaces; }
+                get { return blockIndentationNumberOfSpaces; }
                 set
                 {
-                    optionScriptBlocksIndentationNumberOfSpaces = value;
+                    blockIndentationNumberOfSpaces = value;
                     evaluator?.RefreshIndentedBlockDetection();
                 }
             }
@@ -997,7 +1048,7 @@ public bool OptionCaseSensitiveEvaluationActive
                 complexStandardFuncsDictionary = new Dictionary<string, Func<ExpressionEvaluator, List<string>, object>>(complexStandardFuncsDictionary, StringComparerForCasing);
                 RefreshBlockStartDetection();
                 RefreshBlocksKeywordDetection();
-                RefreshEndOfExpressionDetection();
+                RefreshStatementTerminalPunctuatorDetection();
                 RefreshInstanceCreationKeywordRegexPattern();
             }
         }
@@ -1042,7 +1093,7 @@ public CultureInfo CultureInfoForNumberParsing
         /// <summary>
         /// Allow to change the decimal separator of numbers when parsing expressions.
         /// <para>Default value : <c>"."</c></para>
-        /// Warning if using comma change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts.<para/>
+        /// Warning if using comma change also OptionsSyntaxRules.FunctionArgumentsSeparator and OptionsSyntaxRules.InitializersSeparator otherwise it will create conflicts.<para/>
         /// Modify CultureInfoForNumberParsing.
         /// </summary>
         public string OptionNumberParsingDecimalSeparator
@@ -1068,7 +1119,7 @@ public string OptionNumberParsingDecimalSeparator
         /// <summary>
         /// Allow to change the thousand separator of numbers when parsing expressions.
         /// <para>Default value : <c>string.Empty</c></para>
-        /// Warning if using comma change also OptionFunctionArgumentsSeparator and OptionInitializersSeparator otherwise it will create conflicts.<para/>
+        /// Warning if using comma change also OptionsSyntaxRules.FunctionArgumentsSeparator and OptionsSyntaxRules.InitializersSeparator otherwise it will create conflicts.<para/>
         /// Modify CultureInfoForNumberParsing.
         /// </summary>
         public string OptionNumberParsingThousandSeparator
@@ -1089,35 +1140,6 @@ public string OptionNumberParsingThousandSeparator
             }
         }
 
-        protected bool isBlockStartBracketAWord;
-        protected bool isBlockEndBracketAWord;
-        private Func<ExpressionEvaluator, List<string>, object> newMethodMem;
-
-        /// <summary>
-        /// If <c>true</c> allow to create instance of object with the Default function new(ClassNam,...)<para/>
-        /// If <c>false</c> unactive this functionality.
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionNewFunctionEvaluationActive
-        {
-            get
-            {
-                return complexStandardFuncsDictionary.ContainsKey("new");
-            }
-            set
-            {
-                if (value && !complexStandardFuncsDictionary.ContainsKey("new"))
-                {
-                    complexStandardFuncsDictionary["new"] = newMethodMem;
-                }
-                else if (!value && complexStandardFuncsDictionary.ContainsKey("new"))
-                {
-                    newMethodMem = complexStandardFuncsDictionary["new"];
-                    complexStandardFuncsDictionary.Remove("new");
-                }
-            }
-        }
-
         /// <summary>
         /// If <c>ReturnAutomaticallyLastEvaluatedExpression</c> ScriptEvaluate return automatically the last evaluated expression if no return keyword is met<para/>
         /// If <c>ReturnNull</c> return null if no return keyword is met<para/>
@@ -1126,20 +1148,6 @@ public bool OptionNewFunctionEvaluationActive
         /// </summary>
         public OptionOnNoReturnKeywordFoundInScriptAction OptionOnNoReturnKeywordFoundInScriptAction { get; set; }
 
-        /// <summary>
-        /// Specify to skip the evaluation of an empty expression in scripts otherwise it will throw an exception.
-        /// For example when two semicolon ;; are present or when there are empty line with OptionScriptEndOfExpression set to end of line characters { "\r\n", "\r", "\n" }
-        /// <para>Default value : <c>true;</c></para>
-        /// </summary>
-        public bool OptionScriptSkipEmptyExpressions { get; set; } = true;
-
-        /// <summary>
-        /// If <c>true</c> ScriptEvaluate need to have a semicolon [;] or the specified text in OptionScriptEndOfExpression after each expression.<para/>
-        /// If <c>false</c> Allow to omit the OptionScriptEndOfExpression for the last expression of the script.
-        /// <para>Default value : <c>true</c></para>
-        /// </summary>
-        public bool OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression { get; set; } = true;
-
         /// <summary>
         /// If <c>true</c> Allow to access fields, properties and methods that are not declared public. (private, protected and internal)<para/>
         /// If <c>false</c> Allow access only to public members.
@@ -1416,21 +1424,21 @@ void ExecuteBlocksStacks()
 
                     if (blockKeywordsBeginingMatch.Success)
                     {
-                        if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
-                            || (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any && !blockKeywordsBeginingMatch.Groups["startBracket"].Success))
+                        if (OptionsSyntaxRules.SyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.SeparatorBetweenHeadAndBlock
+                            || (OptionsSyntaxRules.SyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Any && !blockKeywordsBeginingMatch.Groups["startBracket"].Success))
                         {
-                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadSubExpressionsSeparator, null, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator);
+                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.BlocksKeywordsHeadSubExpressionsSeparator, null, OptionsSyntaxRules.BlockKeywordsHeadExpressionAndBlockSeparator);
                         }
                         else
                         {
-                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadSubExpressionsSeparator, OptionsSyntaxRules.OptionScriptBlocksKeywordsHeadStatementsStartBracket, OptionsSyntaxRules.OptionScriptBlocksKeywordsHeadExpressionEndBracket);
+                            keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.BlocksKeywordsHeadSubExpressionsSeparator, OptionsSyntaxRules.BlocksKeywordsHeadStatementsStartBracket, OptionsSyntaxRules.BlocksKeywordsHeadExpressionEndBracket);
 
-                            if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.HeadBrackets)
+                            if (OptionsSyntaxRules.SyntaxForHeadStatementInBlocksKeywords != SyntaxForHeadStatementInBlocksKeywords.HeadBrackets)
                             {
                                 Match blockKeywordsHeadAndBodySeparatorMatch = blockKeywordsHeadAndBodySeparatorRegex.Match(script.Substring(i + 1));
 
-                                if (OptionsSyntaxRules.OptionScriptSyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Both && !blockKeywordsHeadAndBodySeparatorMatch.Success)
-                                    throw new ExpressionEvaluatorSyntaxErrorException($"A Separator Token [{OptionsSyntaxRules.OptionScriptBlockKeywordsHeadExpressionAndBlockSeparator}] was expected after the [{keyword}] keyword head expression");
+                                if (OptionsSyntaxRules.SyntaxForHeadStatementInBlocksKeywords == SyntaxForHeadStatementInBlocksKeywords.Both && !blockKeywordsHeadAndBodySeparatorMatch.Success)
+                                    throw new ExpressionEvaluatorSyntaxErrorException($"A Separator Token [{OptionsSyntaxRules.BlockKeywordsHeadExpressionAndBlockSeparator}] was expected after the [{keyword}] keyword head expression");
 
                                 i += blockKeywordsHeadAndBodySeparatorMatch.Length;
                             }
@@ -1441,7 +1449,7 @@ void ExecuteBlocksStacks()
 
                     string subScript = string.Empty;
 
-                    if (OptionsSyntaxRules.OptionScriptSyntaxForBlocksIdentifier == SyntaxForScriptBlocksIdentifier.Indentation)
+                    if (OptionsSyntaxRules.SyntaxForBlockIdentifier == SyntaxForBlockIdentifier.Indentation)
                     {
                         Match blockIndentationMatch = blockIndentationRegex.Match(script.Substring(i));
                         if (blockIndentationMatch.Success)
@@ -1470,8 +1478,8 @@ void ExecuteBlocksStacks()
                         }
                         else
                         {
-                            if (OptionsSyntaxRules.OptionScriptSyntaxForBlocksIdentifier == SyntaxForScriptBlocksIdentifier.MandatoryBracketsForStartAndEnd)
-                                throw new ExpressionEvaluatorSyntaxErrorException($"$A block of code must be defined between \"{OptionsSyntaxRules.OptionScriptBlockStartBracket}\" and \"{OptionsSyntaxRules.OptionScriptBlockEndBracket}\" after a [{keyword}] keyword");
+                            if (OptionsSyntaxRules.SyntaxForBlockIdentifier == SyntaxForBlockIdentifier.MandatoryBracketsForStartAndEnd)
+                                throw new ExpressionEvaluatorSyntaxErrorException($"$A block of code must be defined between \"{OptionsSyntaxRules.BlockStartBracket}\" and \"{OptionsSyntaxRules.BlockEndBracket}\" after a [{keyword}] keyword");
 
                             bool continueExpressionParsing = true;
                             startOfExpression = i;
@@ -1479,15 +1487,15 @@ void ExecuteBlocksStacks()
                             while (i < script.Length && continueExpressionParsing)
                             {
                                 if (TryParseStringAndParenthesesAndCurlyBrackets(script, ref i)) { }
-                                else if (script.Length - i >= 3 && OptionsSyntaxRules.OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
+                                else if (script.Length - i >= 3 && OptionsSyntaxRules.StatementTerminalPunctuators.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
                                 {
                                     i += 2;
                                 }
-                                else if (nextIsEndOfExpressionRegex.IsMatch(script.Substring(i)))
+                                else if (nextIsStatementTerminalPunctuatorRegex.IsMatch(script.Substring(i)))
                                 {
                                     subScript = script.Substring(startOfExpression, i + 1 - startOfExpression);
                                     continueExpressionParsing = false;
-                                    i += OptionsSyntaxRules.OptionScriptEndOfExpression.Length - 1;
+                                    i += OptionsSyntaxRules.StatementTerminalPunctuators.Length - 1;
                                 }
 
                                 i++;
@@ -1568,13 +1576,13 @@ void ExecuteBlocksStacks()
                                 && blockKeywordsBeginingMatch.Groups["keyword"].Value.Equals("while", StringComparisonForCasing))
                             {
                                 i += blockKeywordsBeginingMatch.Length;
-                                keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.OptionScriptBlockKeywordsHeadSubExpressionsSeparator);
+                                keywordParameters = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref i, true, OptionsSyntaxRules.BlocksKeywordsHeadSubExpressionsSeparator);
 
                                 i++;
 
                                 Match nextIsEndOfExpressionMatch;
 
-                                if ((nextIsEndOfExpressionMatch = nextIsEndOfExpressionRegex.Match(script.Substring(i))).Success)
+                                if ((nextIsEndOfExpressionMatch = nextIsStatementTerminalPunctuatorRegex.Match(script.Substring(i))).Success)
                                 {
                                     i += nextIsEndOfExpressionMatch.Length;
 
@@ -1596,7 +1604,7 @@ void ExecuteBlocksStacks()
                                 }
                                 else
                                 {
-                                    throw new ExpressionEvaluatorSyntaxErrorException($"A [{OptionsSyntaxRules.OptionScriptEndOfExpression}] is missing. (After the do while condition)");
+                                    throw new ExpressionEvaluatorSyntaxErrorException($"A [{OptionsSyntaxRules.StatementTerminalPunctuators}] is missing. (After the do while condition)");
                                 }
                             }
                             else
@@ -1689,11 +1697,11 @@ void forAction(int index)
                     Match nextIsEndOfExpressionMatch;
 
                     if (TryParseStringAndParenthesesAndCurlyBrackets(script, ref i)) { }
-                    else if (script.Length - i >= 3 && OptionsSyntaxRules.OptionScriptEndOfExpression.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
+                    else if (script.Length - i >= 3 && OptionsSyntaxRules.StatementTerminalPunctuators.Any(o => o.Length == 1 && script.Substring(i, 3).Equals($"'{o}'")))
                     {
                         i += 2;
                     }
-                    else if ((nextIsEndOfExpressionMatch = nextIsEndOfExpressionRegex.Match(script.Substring(i))).Success)
+                    else if ((nextIsEndOfExpressionMatch = nextIsStatementTerminalPunctuatorRegex.Match(script.Substring(i))).Success)
                     {
                         lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
                         i += nextIsEndOfExpressionMatch.Length - 1;
@@ -1701,7 +1709,7 @@ void forAction(int index)
                         executed = true;
                     }
 
-                    if (!OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression && i == script.Length - 1 && !executed)
+                    if (!OptionsSyntaxRules.MandatoryLastStatementTerminalPunctuator && i == script.Length - 1 && !executed)
                     {
                         i++;
                         lastResult = ScriptExpressionEvaluate(script, ref startOfExpression, ref i, ref isBreak, ref isContinue, ref isReturn, lastResult);
@@ -1711,13 +1719,13 @@ void forAction(int index)
                     ifBlockEvaluatedState = IfBlockEvaluatedState.NoBlockEvaluated;
                     tryBlockEvaluatedState = TryBlockEvaluatedState.NoBlockEvaluated;
 
-                    if (OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression || i < script.Length)
+                    if (OptionsSyntaxRules.MandatoryLastStatementTerminalPunctuator || i < script.Length)
                         i++;
                 }
             }
 
-            if (!script.Substring(startOfExpression).Trim().Equals(string.Empty) && !isReturn && !isBreak && !isContinue && OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression)
-                throw new ExpressionEvaluatorSyntaxErrorException($"An end of expression [{string.Join(",", OptionsSyntaxRules.OptionScriptEndOfExpression.Select(s => "\"" + Regex.Escape(s) + "\""))}] token is missing.");
+            if (!script.Substring(startOfExpression).Trim().Equals(string.Empty) && !isReturn && !isBreak && !isContinue && OptionsSyntaxRules.MandatoryLastStatementTerminalPunctuator)
+                throw new ExpressionEvaluatorSyntaxErrorException($"An end of expression [{string.Join(",", OptionsSyntaxRules.StatementTerminalPunctuators.Select(s => "\"" + Regex.Escape(s) + "\""))}] token is missing.");
 
             ExecuteBlocksStacks();
 
@@ -1841,7 +1849,7 @@ protected virtual object ScriptExpressionEvaluate(string script, ref int startOf
 
             startOfExpression = index + 1;
 
-            if (OptionScriptSkipEmptyExpressions && string.IsNullOrWhiteSpace(expression))
+            if (OptionsSyntaxRules.SkipEmptyExpressions && string.IsNullOrWhiteSpace(expression))
                 return lastResult;
             else
                 return ManageJumpStatementsOrExpressionEval(expression, ref isBreak, ref isContinue, ref isReturn, lastResult);
@@ -1899,9 +1907,9 @@ protected virtual bool TryParseStringAndParenthesesAndCurlyBrackets(string scrip
                 index++;
                 GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(script, ref index, false);
             }
-            else if (script.Substring(index).StartsWith(OptionsSyntaxRules.OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, index - 1, index + OptionsSyntaxRules.OptionScriptBlockStartBracket.Length)))
+            else if (script.Substring(index).StartsWith(OptionsSyntaxRules.BlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(script, index - 1, index + OptionsSyntaxRules.BlockStartBracket.Length)))
             {
-                index += OptionsSyntaxRules.OptionScriptBlockStartBracket.Length;
+                index += OptionsSyntaxRules.BlockStartBracket.Length;
                 GetScriptBetweenBlockBrackets(script, ref index);
             }
             else
@@ -2090,7 +2098,7 @@ protected virtual bool EvaluateNumber(string expression, Stack<object> stack, re
 
         protected virtual bool EvaluateInstanceCreationWithNewKeyword(string expression, Stack<object> stack, ref int i)
         {
-            if (!OptionsFunctionalities.OptionNewKeywordEvaluationActive)
+            if (!OptionsFunctionalities.NewKeywordEvaluationActive)
                 return false;
 
             Match instanceCreationMatch = instanceCreationKeywordRegex.Match(expression.Substring(i));
@@ -2128,7 +2136,7 @@ void InitSimpleObject(object element, List<string> initArgs)
                 {
                     object element = new ExpandoObject();
 
-                    List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
+                    List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
 
                     InitSimpleObject(element, initArgs);
 
@@ -2163,7 +2171,7 @@ void Init(object element, List<string> initArgs)
                             {
                                 int subIndex = subExpr.IndexOf("{") + 1;
 
-                                List<string> subArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(subExpr, ref subIndex, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
+                                List<string> subArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(subExpr, ref subIndex, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
 
                                 if (subArgs.Count == 2)
                                 {
@@ -2185,7 +2193,7 @@ void Init(object element, List<string> initArgs)
 
                     if (instanceCreationMatch.Groups["isfunction"].Success)
                     {
-                        List<string> constructorArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionFunctionArgumentsSeparator);
+                        List<string> constructorArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.FunctionArgumentsSeparator);
                         i++;
 
                         List<object> cArgs = constructorArgs.ConvertAll(Evaluate);
@@ -2198,7 +2206,7 @@ void Init(object element, List<string> initArgs)
                         {
                             i += blockBeginningMatch.Length;
 
-                            List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
+                            List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
 
                             Init(element, initArgs);
                         }
@@ -2213,7 +2221,7 @@ void Init(object element, List<string> initArgs)
                     {
                         object element = Activator.CreateInstance(type, new object[0]);
 
-                        List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
+                        List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
 
                         Init(element, initArgs);
 
@@ -2221,7 +2229,7 @@ void Init(object element, List<string> initArgs)
                     }
                     else if (instanceCreationMatch.Groups["isArray"].Success)
                     {
-                        List<string> arrayArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "[", "]");
+                        List<string> arrayArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "[", "]");
                         i++;
                         Array array = null;
 
@@ -2236,7 +2244,7 @@ void Init(object element, List<string> initArgs)
                         {
                             i += initInNewBeginningMatch.Length;
 
-                            List<string> arrayElements = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionInitializersSeparator, "{", "}");
+                            List<string> arrayElements = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
 
                             if (array == null)
                                 array = Array.CreateInstance(type, arrayElements.Count);
@@ -2285,7 +2293,7 @@ protected virtual bool EvaluateVarOrFunc(string expression, Stack<object> stack,
 
                 if (varFuncMatch.Groups["isfunction"].Success)
                 {
-                    List<string> funcArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.OptionFunctionArgumentsSeparator);
+                    List<string> funcArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.FunctionArgumentsSeparator);
 
                     if (inObject
                         || Context?.GetType()
@@ -2382,9 +2390,9 @@ protected virtual bool EvaluateVarOrFunc(string expression, Stack<object> stack,
 
                                     BindingFlags flag = DetermineInstanceOrStatic(ref objType, ref obj, ref valueTypeNestingTrace);
 
-                                    if (!OptionsFunctionalities.OptionStaticMethodsCallActive && (flag & BindingFlags.Static) != 0)
+                                    if (!OptionsFunctionalities.StaticMethodsCallActive && (flag & BindingFlags.Static) != 0)
                                         throw new ExpressionEvaluatorSyntaxErrorException($"[{objType}] object has no Method named \"{varFuncName}\".");
-                                    if (!OptionsFunctionalities.OptionInstanceMethodsCallActive && (flag & BindingFlags.Instance) != 0)
+                                    if (!OptionsFunctionalities.InstanceMethodsCallActive && (flag & BindingFlags.Instance) != 0)
                                         throw new ExpressionEvaluatorSyntaxErrorException($"[{objType}] object has no Method named \"{varFuncName}\".");
 
                                     // Standard Instance or public method find
@@ -2620,9 +2628,9 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
                                 {
                                     BindingFlags flag = DetermineInstanceOrStatic(ref objType, ref obj, ref valueTypeNestingTrace);
 
-                                    if (!OptionsFunctionalities.OptionStaticPropertiesGetActive && (flag & BindingFlags.Static) != 0)
+                                    if (!OptionsFunctionalities.StaticPropertiesGetActive && (flag & BindingFlags.Static) != 0)
                                         throw new ExpressionEvaluatorSyntaxErrorException($"[{objType}] object has no public Property or Field named \"{varFuncName}\".");
-                                    if (!OptionsFunctionalities.OptionInstancePropertiesGetActive && (flag & BindingFlags.Instance) != 0)
+                                    if (!OptionsFunctionalities.InstancePropertiesGetActive && (flag & BindingFlags.Instance) != 0)
                                         throw new ExpressionEvaluatorSyntaxErrorException($"[{objType}] object has no public Property or Field named \"{varFuncName}\".");
 
                                     bool isDynamic = (flag & BindingFlags.Instance) != 0 && obj is IDynamicMetaObjectProvider && obj is IDictionary<string, object>;
@@ -2693,7 +2701,7 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
                                         stack.Push(varValue);
                                     }
 
-                                    if (OptionsFunctionalities.OptionPropertyOrFieldSetActive)
+                                    if (OptionsFunctionalities.PropertyOrFieldSetActive)
                                     {
                                         if (varFuncMatch.Groups["assignationOperator"].Success)
                                         {
@@ -2801,7 +2809,7 @@ where method.GetParameters()[0].ParameterType == objType // static extMethod(thi
 
                             stack.Push(cusVarValueToPush);
 
-                            if (OptionsFunctionalities.OptionVariableAssignationActive)
+                            if (OptionsFunctionalities.VariableAssignationActive)
                             {
                                 bool assign = true;
 
@@ -2888,7 +2896,7 @@ protected virtual Type EvaluateType(string expression,ref int i, string currentN
             Type staticType = GetTypeByFriendlyName(typeName, genericsTypes);
 
             // For inline namespace parsing
-            if (staticType == null && OptionsFunctionalities.OptionInlineNamespacesEvaluationActive)
+            if (staticType == null && OptionsFunctionalities.InlineNamespacesEvaluationActive)
             {
                 int subIndex = 0;
                 Match namespaceMatch = varOrFunctionRegEx.Match(expression.Substring(i + subIndex));
@@ -2969,7 +2977,7 @@ protected virtual Type EvaluateType(string expression,ref int i, string currentN
 
         protected virtual bool EvaluateChar(string expression, Stack<object> stack, ref int i)
         {
-            if (!OptionsFunctionalities.OptionCharEvaluationActive)
+            if (!OptionsFunctionalities.CharEvaluationActive)
                 return false;
 
             string s = expression.Substring(i, 1);
@@ -3137,7 +3145,7 @@ protected virtual void CorrectStackWithUnaryPlusOrMinusBeforeParenthisIfNecessar
 
         protected virtual bool EvaluateIndexing(string expression, Stack<object> stack, ref int i)
         {
-            if (!OptionsFunctionalities.OptionIndexingActive)
+            if (!OptionsFunctionalities.IndexingActive)
                 return false;
 
             Match indexingBeginningMatch = indexingBeginningRegex.Match(expression.Substring(i));
@@ -3237,7 +3245,7 @@ object GetIndexedObject()
                             return left[oIndexingArgs[0]];
                     }
 
-                    if (OptionsFunctionalities.OptionIndexingAssignationActive && (assignationOrPostFixOperatorMatch = assignationOrPostFixOperatorRegex.Match(expression.Substring(i + 1))).Success)
+                    if (OptionsFunctionalities.IndexingAssignationActive && (assignationOrPostFixOperatorMatch = assignationOrPostFixOperatorRegex.Match(expression.Substring(i + 1))).Success)
                     {
                         i += assignationOrPostFixOperatorMatch.Length + 1;
 
@@ -3296,7 +3304,7 @@ object GetIndexedObject()
 
         protected virtual bool EvaluateString(string expression, Stack<object> stack, ref int i)
         {
-            if (!OptionsFunctionalities.OptionStringEvaluationActive)
+            if (!OptionsFunctionalities.StringEvaluationActive)
                 return false;
 
             Match stringBeginningMatch = stringBeginningRegex.Match(expression.Substring(i));
@@ -3740,7 +3748,7 @@ protected virtual MethodInfo GetRealMethod(ref Type type, ref object obj, string
             List<object> modifiedArgs = new List<object>(args);
             Type typeCopy = type;
 
-            if (OptionsFunctionalities.OptionFluidPrefixingActive
+            if (OptionsFunctionalities.FluidPrefixingActive
                 && (func.StartsWith("Fluid", StringComparisonForCasing)
                     || func.StartsWith("Fluent", StringComparisonForCasing)))
             {
@@ -4203,15 +4211,15 @@ protected virtual string GetScriptBetweenBlockBrackets(string parentScript, ref
                 {
                     s = parentScript.Substring(index);
 
-                    if (s.StartsWith(OptionsSyntaxRules.OptionScriptBlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionsSyntaxRules.OptionScriptBlockStartBracket.Length)))
+                    if (s.StartsWith(OptionsSyntaxRules.BlockStartBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionsSyntaxRules.BlockStartBracket.Length)))
                     {
                         bracketCount++;
-                        index += OptionsSyntaxRules.OptionScriptBlockStartBracket.Length - 1;
+                        index += OptionsSyntaxRules.BlockStartBracket.Length - 1;
                     }
-                    else if (s.StartsWith(OptionsSyntaxRules.OptionScriptBlockEndBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionsSyntaxRules.OptionScriptBlockEndBracket.Length)))
+                    else if (s.StartsWith(OptionsSyntaxRules.BlockEndBracket) && (!isBlockStartBracketAWord || ValidateKeywordBoundaries(parentScript, index - 1, index + OptionsSyntaxRules.BlockEndBracket.Length)))
                     {
                         bracketCount--;
-                        index += OptionsSyntaxRules.OptionScriptBlockEndBracket.Length - 1;
+                        index += OptionsSyntaxRules.BlockEndBracket.Length - 1;
                         if (bracketCount == 0)
                             break;
                     }
@@ -4226,7 +4234,7 @@ protected virtual string GetScriptBetweenBlockBrackets(string parentScript, ref
             {
                 string beVerb = bracketCount == 1 ? "is" : "are";
                 string singularPlurial = bracketCount == 1 ? "" : "s";
-                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} [{OptionsSyntaxRules.OptionScriptBlockEndBracket}] (end of block) token{singularPlurial} {beVerb} missing in script at : [{index}]");
+                throw new ExpressionEvaluatorSyntaxErrorException($"{bracketCount} [{OptionsSyntaxRules.BlockEndBracket}] (end of block) token{singularPlurial} {beVerb} missing in script at : [{index}]");
             }
 
             return currentScript;
@@ -4244,13 +4252,13 @@ protected virtual List<string> GetExpressionsBetweenParenthesesOrOtherImbricable
                 Match internalStringMatch = stringBeginningRegex.Match(subExpr);
                 Match internalCharMatch = internalCharRegex.Match(subExpr);
 
-                if (OptionsFunctionalities.OptionStringEvaluationActive && internalStringMatch.Success)
+                if (OptionsFunctionalities.StringEvaluationActive && internalStringMatch.Success)
                 {
                     string innerString = internalStringMatch.Value + GetCodeUntilEndOfString(expression.Substring(i + internalStringMatch.Length), internalStringMatch);
                     currentExpression += innerString;
                     i += innerString.Length - 1;
                 }
-                else if (OptionsFunctionalities.OptionCharEvaluationActive && internalCharMatch.Success)
+                else if (OptionsFunctionalities.CharEvaluationActive && internalCharMatch.Success)
                 {
                     currentExpression += internalCharMatch.Value;
                     i += internalCharMatch.Length - 1;
@@ -4329,11 +4337,11 @@ protected virtual bool DefaultFunctions(string name, List<string> args, out obje
             {
                 result = complexFunc(this, args);
             }
-            else if (OptionsFunctionalities.OptionEvaluateFunctionActive && name.Equals("Evaluate", StringComparisonForCasing))
+            else if (OptionsFunctionalities.EvaluateFunctionActive && name.Equals("Evaluate", StringComparisonForCasing))
             {
                 result = Evaluate((string)Evaluate(args[0]));
             }
-            else if (OptionsFunctionalities.OptionScriptEvaluateFunctionActive && name.Equals("ScriptEvaluate", StringComparisonForCasing))
+            else if (OptionsFunctionalities.ScriptEvaluateFunctionActive && name.Equals("ScriptEvaluate", StringComparisonForCasing))
             {
                 bool oldInScript = inScript;
                 result = ScriptEvaluate((string)Evaluate(args[0]));
@@ -4769,14 +4777,14 @@ public enum SyntaxForHeadStatementInBlocksKeywords
         Any
     }
 
-    public enum SyntaxForScriptBlocksIdentifier
+    public enum SyntaxForBlockIdentifier
     {
         OptionalBracketsForStartAndEndWhenSingleStatement,
         MandatoryBracketsForStartAndEnd,
         Indentation
     }
 
-    public enum ScriptBlocksIndentation
+    public enum BlockIndentation
     {
         Tabulation,
         Spaces
diff --git a/TryWindow/MainWindow.xaml.cs b/TryWindow/MainWindow.xaml.cs
index 58d6321..0056e4c 100644
--- a/TryWindow/MainWindow.xaml.cs
+++ b/TryWindow/MainWindow.xaml.cs
@@ -38,7 +38,10 @@ private async void CalculateButton_Click(object sender, RoutedEventArgs e)
 
             ExpressionEvaluator evaluator = new ExpressionEvaluator()
             {
-                OptionScriptNeedEndOfExpressionTokenAtTheEndOfLastExpression = NeedSemicolonAtTheEndCheckBox.IsChecked.GetValueOrDefault(),
+                OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                {
+                    MandatoryLastStatementTerminalPunctuator = NeedSemicolonAtTheEndCheckBox.IsChecked.GetValueOrDefault(),
+                },
                 OptionCaseSensitiveEvaluationActive = CaseSensitiveCheckBox.IsChecked.GetValueOrDefault()
             };
 

From e56fafbbfdde985b6603fd60a5482a96b06a94ca Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 21 May 2021 09:23:42 +0200
Subject: [PATCH 37/48] IsNewKeywordForAnonymousExpandoObjectOptional

---
 .../ExpressionEvaluatorTests.cs               | 18 ++++++++++++++
 .../ExpressionEvaluator.cs                    | 24 +++++++++++++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
index 54df190..cce4e0b 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
@@ -2505,6 +2505,24 @@ ExpressionEvaluator evaluatorForMethodArgs()
 
                 #endregion
 
+                #region Specific Syntax Rules
+
+                yield return new TestCaseData(new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            IsNewKeywordForAnonymousExpandoObjectOptional = true
+                        }
+                    }
+                    , "{ MyProp = \"Test\"}.MyProp"
+                    , null)
+                    .Returns("Test")
+                    .SetCategory("ExpandoObject")
+                    .SetCategory("Anonymous")
+                    .SetCategory("IsNewKeywordForAnonymousExpandoObjectOptional");
+
+                #endregion
+
                 #region Issues/Bug resolution
 
                 yield return new TestCaseData(new ExpressionEvaluator()
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 62b23f6..82bc6e2 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -123,7 +123,8 @@ protected virtual void RefreshStatementTerminalPunctuatorDetection()
 
         protected virtual void RefreshInstanceCreationKeywordRegexPattern()
         {
-            instanceCreationKeywordRegex = new Regex("^(" + string.Join("|", OptionsSyntaxRules.KeywordNew.Select(o => Regex.Escape(o))) + @")(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9" + (OptionsFunctionalities.InlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
+            var keywords = string.Join("|", OptionsSyntaxRules.KeywordNew.Select(o => Regex.Escape(o)));
+            instanceCreationKeywordRegex = new Regex("^((((" + keywords + @")(?>\s*))" + (OptionsSyntaxRules.IsNewKeywordForAnonymousExpandoObjectOptional ? "?" : string.Empty) +"(?<isAnonymous>[{{]))|(((" + keywords + @")(?>\s+))(?<name>[\p{L}_][\p{L}_0-9" + (OptionsFunctionalities.InlineNamespacesEvaluationActive ? @"\." : string.Empty) + @"]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", CompiledRegexOptionAndIfNecessaryIgnoreCase);
         }
 
         protected virtual void RefreshCastRegex()
@@ -836,6 +837,24 @@ public string[] KeywordNew
                 }
             }
 
+            private bool isNewKeywordForAnonymousExpandoObjectOptional;
+            /// <summary>
+            /// If <c>true</c> Allow to omit the keyword new or equivalent defined in KeywordNew for anonymous ExpandoObject.<para/>
+            /// Example : <c>var myVar = { SomeProperties = someValues }</c><para/>
+            /// If <c>false</c> the new keyword or an equivalent defined in KeywordNew is mandatory<para/>
+            /// Example : <c>var myVar = new { SomeProperties = someValues }</c><para/>
+            /// <para>Default value : <c>false</c></para>
+            /// </summary>
+            public bool IsNewKeywordForAnonymousExpandoObjectOptional
+            {
+                get { return isNewKeywordForAnonymousExpandoObjectOptional; }
+                set
+                {
+                    isNewKeywordForAnonymousExpandoObjectOptional = value;
+                    evaluator?.RefreshInstanceCreationKeywordRegexPattern();
+                }
+            }
+
             private string[] statementTerminalPunctuators = new[] { ";" };
             /// <summary>
             /// An array of string that are used to separate expressions (statements) in script
@@ -854,7 +873,7 @@ public string[] StatementTerminalPunctuators
             /// <summary>
             /// Specify to skip the evaluation of an empty expression in scripts otherwise it will throw an exception.
             /// For example when two semicolon <c>;;</c> are present or when there are empty line with StatementTerminalPunctuators set to end of line characters <c>{ "\r\n", "\r", "\n" }</c>
-            /// <para>Default value : <c>true;</c></para>
+            /// <para>Default value : <c>true</c></para>
             /// </summary>
             public bool SkipEmptyExpressions { get; set; } = true;
 
@@ -989,6 +1008,7 @@ public BlockIndentation BlockIndentation
             }
 
             private int blockIndentationNumberOfSpaces = 4;
+
             /// <summary>
             /// Set the number of spaces to use as an indentation when : <para/>
             /// <c>SyntaxForBlockIdentifier = SyntaxForBlockIdentifier.Indentation</c><para/>

From bf2a89a237ade82f6b2d65b0ca19e95ec6fe0e04 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 21 May 2021 13:46:50 +0200
Subject: [PATCH 38/48] Small refactors and comment editing

---
 .../ExpressionEvaluatorTests.cs               |  2 +-
 .../ExpressionEvaluator.cs                    | 40 ++++++++++---------
 2 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
index cce4e0b..e30c0c0 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
@@ -2505,7 +2505,7 @@ ExpressionEvaluator evaluatorForMethodArgs()
 
                 #endregion
 
-                #region Specific Syntax Rules
+                #region Anonymous ExpandoObjects SpecificSyntax and Collection init simplified syntax (Jsonify)
 
                 yield return new TestCaseData(new ExpressionEvaluator()
                     {
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 82bc6e2..f390894 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -622,7 +622,7 @@ internal virtual void Init() { }
 
         #endregion
 
-        #region Functionalities options
+        #region Functionalities activation options
 
         private Func<ExpressionEvaluator, List<string>, object> newMethodMem;
 
@@ -1129,8 +1129,8 @@ public string OptionNumberParsingDecimalSeparator
                 CultureInfoForNumberParsing.NumberFormat.NumberDecimalSeparator = optionNumberParsingDecimalSeparator;
 
                 numberRegexPattern = string.Format(numberRegexOrigPattern,
-                    optionNumberParsingDecimalSeparator != null ? Regex.Escape(optionNumberParsingDecimalSeparator) : ".",
-                    optionNumberParsingThousandSeparator != null ? Regex.Escape(optionNumberParsingThousandSeparator) : "");
+                    Regex.Escape(optionNumberParsingDecimalSeparator) ,
+                    Regex.Escape(optionNumberParsingThousandSeparator));
             }
         }
 
@@ -1155,8 +1155,8 @@ public string OptionNumberParsingThousandSeparator
                 CultureInfoForNumberParsing.NumberFormat.NumberGroupSeparator = value;
 
                 numberRegexPattern = string.Format(numberRegexOrigPattern,
-                    optionNumberParsingDecimalSeparator != null ? Regex.Escape(optionNumberParsingDecimalSeparator) : ".",
-                    optionNumberParsingThousandSeparator != null ? Regex.Escape(optionNumberParsingThousandSeparator) : "");
+                    Regex.Escape(optionNumberParsingDecimalSeparator),
+                    Regex.Escape(optionNumberParsingThousandSeparator));
             }
         }
 
@@ -2132,22 +2132,26 @@ void InitSimpleObject(object element, List<string> initArgs)
                     string variable = "V" + Guid.NewGuid().ToString().Replace("-", "");
 
                     Variables[variable] = element;
-
-                    initArgs.ForEach(subExpr =>
+                    try
                     {
-                        if (subExpr.Contains("="))
-                        {
-                            string trimmedSubExpr = subExpr.TrimStart();
-
-                            Evaluate($"{variable}{(trimmedSubExpr.StartsWith("[") ? string.Empty : ".")}{trimmedSubExpr}");
-                        }
-                        else
+                        initArgs.ForEach(subExpr =>
                         {
-                            throw new ExpressionEvaluatorSyntaxErrorException($"A '=' char is missing in [{subExpr}]. It is in a object initializer. It must contains one.");
-                        }
-                    });
+                            if (subExpr.Contains("="))
+                            {
+                                string trimmedSubExpr = subExpr.TrimStart();
 
-                    Variables.Remove(variable);
+                                Evaluate($"{variable}{(trimmedSubExpr.StartsWith("[") ? string.Empty : ".")}{trimmedSubExpr}");
+                            }
+                            else
+                            {
+                                throw new ExpressionEvaluatorSyntaxErrorException($"A '=' char is missing in [{subExpr}]. It is in a object initializer. It must contains one.");
+                            }
+                        });
+                    }
+                    finally
+                    {
+                        Variables.Remove(variable);
+                    }
                 }
 
                 i += instanceCreationMatch.Length;

From 216c1f8561c318d53e8c1f2fec42fd65accd8e33 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 25 May 2021 12:55:51 +0200
Subject: [PATCH 39/48] #94 relax object syntax part looks OK

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs |  25 ++
 .../ExpressionEvaluatorTests.cs               |  30 ++-
 .../Resources.Designer.cs                     | 243 ++++++++++--------
 .../Resources.resx                            |   3 +
 .../Resources/Script0102.txt                  |   7 +
 .../ExpressionEvaluator.cs                    |  80 ++++--
 6 files changed, 257 insertions(+), 131 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator.Tests/Resources/Script0102.txt

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 7fbe856..6abb252 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -1268,6 +1268,31 @@ public static IEnumerable<TestCaseData> TestCasesForScriptEvaluateTests
                     .SetCategory("conflict variable assignation vs on the fly in object with same name")
                     .Returns("{\"Hello\":3,\"No\":\"Yes\"}");
 
+
+                #endregion
+
+                #region Json syntax stuff for anonymous Expando object
+
+                yield return new TestCaseData(Resources.Script0102,
+                    new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            IsNewKeywordForAnonymousExpandoObjectOptional = true,
+                            InitializerPropertyValueSeparators = new [] {"=", ":" },
+                            InitializerAllowStringForProperties = true,
+                        }
+                    }
+                    , null, null, null)
+                    .SetCategory("Script")
+                    .SetCategory("ExpandoObject")
+                    .SetCategory("return")
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.IsNewKeywordForAnonymousExpandoObjectOptional))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.InitializerPropertyValueSeparators))
+                    .SetCategory(nameof(ExpressionEvaluator.SyntaxRules.InitializerAllowStringForProperties))
+                    .SetCategory("JsonInit")
+                    .Returns(13);
+
                 #endregion
 
                 #region Diactitics
diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
index e30c0c0..3d07c4f 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
@@ -1748,7 +1748,7 @@ public static IEnumerable<TestCaseData> TestCasesEvaluateWithSpecificEvaluator
                     OptionNumberParsingThousandSeparator = "'",
                     OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
                     {
-                        InitializersSeparator = ";"
+                        InitializerSeparator = ";"
                     }
                 }
                  , "new double[]{1'200,5; 1'111'000,7}.Max()"
@@ -2521,6 +2521,34 @@ ExpressionEvaluator evaluatorForMethodArgs()
                     .SetCategory("Anonymous")
                     .SetCategory("IsNewKeywordForAnonymousExpandoObjectOptional");
 
+                yield return new TestCaseData(new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            InitializerPropertyValueSeparators = new[] {"=", ":"}
+                        }
+                    }
+                    , "new { MyProp : \"Test\"}.MyProp"
+                    , null)
+                    .Returns("Test")
+                    .SetCategory("ExpandoObject")
+                    .SetCategory("Anonymous")
+                    .SetCategory("InitializerPropertyValueSeparators");
+
+                yield return new TestCaseData(new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            InitializerAllowStringForProperties = true
+                        }
+                    }
+                    , "new { \"MyProp\" = \"Test\"}.MyProp"
+                    , null)
+                    .Returns("Test")
+                    .SetCategory("ExpandoObject")
+                    .SetCategory("Anonymous")
+                    .SetCategory("InitializerAllowStringForProperties");
+
                 #endregion
 
                 #region Issues/Bug resolution
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
index 0f053d8..6528462 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.Designer.cs
@@ -1,10 +1,10 @@
 ﻿//------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
+//     Ce code a été généré par un outil.
+//     Version du runtime :4.0.30319.42000
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
+//     le code est régénéré.
 // </auto-generated>
 //------------------------------------------------------------------------------
 
@@ -13,12 +13,12 @@ namespace CodingSeb.ExpressionEvaluator.Tests {
     
     
     /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    ///   Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
     /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
+    // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
+    // à l'aide d'un outil, tel que ResGen ou Visual Studio.
+    // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
+    // avec l'option /str ou régénérez votre projet VS.
     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@@ -33,7 +33,7 @@ internal Resources() {
         }
         
         /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
+        ///   Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
         public static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ internal Resources() {
         }
         
         /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
+        ///   Remplace la propriété CurrentUICulture du thread actuel pour toutes
+        ///   les recherches de ressources à l'aide de cette classe de ressource fortement typée.
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
         public static global::System.Globalization.CultureInfo Culture {
@@ -61,7 +61,7 @@ internal Resources() {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0001 */
+        ///   Recherche une chaîne localisée semblable à /* Script0001 */
         ///x = 0;
         ///result = &quot;&quot;;
         ///
@@ -80,7 +80,7 @@ public static string Script0001 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0002 */
+        ///   Recherche une chaîne localisée semblable à /* Script0002 */
         ///result = &quot;&quot;;
         ///
         ///for(x = 0; x &lt; 5;x++)
@@ -97,7 +97,7 @@ public static string Script0002 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0003 */
+        ///   Recherche une chaîne localisée semblable à /* Script0003 */
         ///result = &quot;&quot;;
         ///
         ///for(x = 0; x &lt; 5;x++)
@@ -112,7 +112,7 @@ public static string Script0003 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0004 */
+        ///   Recherche une chaîne localisée semblable à /* Script0004 */
         ///x = [valx];
         ///y = [valy];
         ///result = 0;
@@ -143,7 +143,7 @@ public static string Script0004 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0005 */
+        ///   Recherche une chaîne localisée semblable à /* Script0005 */
         ///x = [valx];
         ///y = [valy];
         ///result = 0;
@@ -166,7 +166,7 @@ public static string Script0005 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0006 */
+        ///   Recherche une chaîne localisée semblable à /* Script0006 */
         ///List(1,2,3,4)
         ///    .Find((element) =&gt; 
         ///    {
@@ -181,7 +181,7 @@ public static string Script0006 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0007 */
+        ///   Recherche une chaîne localisée semblable à /* Script0007 */
         ///x = 4;
         ///y = 0;
         ///
@@ -202,7 +202,7 @@ public static string Script0007 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0008 */
+        ///   Recherche une chaîne localisée semblable à /* Script0008 */
         ///x = [valx];
         ///
         ///if(x == 0)
@@ -217,7 +217,7 @@ public static string Script0008 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0009 */
+        ///   Recherche une chaîne localisée semblable à /* Script0009 */
         ///x = &quot;&quot;;
         ///
         ///for(i = 0; i &lt; 10; i++)
@@ -240,7 +240,7 @@ public static string Script0009 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0010 */
+        ///   Recherche une chaîne localisée semblable à /* Script0010 */
         ///x = &quot;&quot;;
         ///i = -1;
         ///
@@ -266,7 +266,7 @@ public static string Script0010 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0011 */
+        ///   Recherche une chaîne localisée semblable à /* Script0011 */
         ///list = List(5,5,5,5,5,5,5,5,5,5,5);
         ///
         ///list[0] = 8;
@@ -290,7 +290,7 @@ public static string Script0011 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0012 */
+        ///   Recherche une chaîne localisée semblable à /* Script0012 */
         ///list = List(5,5,5,5,5,5);
         ///
         ///list[0]++;
@@ -307,7 +307,7 @@ public static string Script0012 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0013 */
+        ///   Recherche une chaîne localisée semblable à /* Script0013 */
         ///x = 0;
         ///result = &quot;&quot;;
         ///
@@ -327,7 +327,7 @@ public static string Script0013 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0014 */
+        ///   Recherche une chaîne localisée semblable à /* Script0014 */
         ///x = 0;
         ///result = &quot;&quot;;
         ///
@@ -347,7 +347,7 @@ public static string Script0014 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0015 */
+        ///   Recherche une chaîne localisée semblable à /* Script0015 */
         ///x = 0;
         ///result = &quot;&quot;;
         ///
@@ -367,7 +367,7 @@ public static string Script0015 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0016 */
+        ///   Recherche une chaîne localisée semblable à /* Script0016 */
         ///Add = (x, y) =&gt; x + y;
         ///
         ///return Add(3, 4);.
@@ -379,7 +379,7 @@ public static string Script0016 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0017 */
+        ///   Recherche une chaîne localisée semblable à /* Script0017 */
         ///
         ///FirstFunc = x =&gt; 
         ///{
@@ -398,7 +398,7 @@ public static string Script0017 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0018 */
+        ///   Recherche une chaîne localisée semblable à /* Script0018 */
         ///
         ///result = string.Empty;
         ///elements = List(&quot;This&quot;, &quot;is&quot;, &quot;a&quot;, &quot;splitted&quot;, &quot;text&quot;);
@@ -418,7 +418,7 @@ public static string Script0018 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0019 */
+        ///   Recherche une chaîne localisée semblable à /* Script0019 */
         ///myVar = new ExpandoObject();
         ///
         ///myVar.X = 23.5;
@@ -433,7 +433,7 @@ public static string Script0019 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0020 */
+        ///   Recherche une chaîne localisée semblable à /* Script0020 */
         ///myVar = new ExpandoObject();
         ///
         ///myVar[&quot;X&quot;] = 23.5;
@@ -448,7 +448,7 @@ public static string Script0020 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0021 */
+        ///   Recherche une chaîne localisée semblable à /* Script0021 */
         ///myVar = new ExpandoObject();
         ///
         ///myVar[&quot;X&quot;] = 23.5;
@@ -463,7 +463,7 @@ public static string Script0021 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0022 */
+        ///   Recherche une chaîne localisée semblable à /* Script0022 */
         ///myVar = new ExpandoObject();
         ///
         ///myVar.X = 23.5;
@@ -478,7 +478,7 @@ public static string Script0022 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0023 */
+        ///   Recherche une chaîne localisée semblable à /* Script0023 */
         ///myVar = new ExpandoObject();
         ///
         ///myVar.X = 2;
@@ -495,7 +495,7 @@ public static string Script0023 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0024 */
+        ///   Recherche une chaîne localisée semblable à /* Script0024 */
         ///obj = new ExpandoObject();
         ///
         ///obj.Add = (x, y) =&gt; 
@@ -513,7 +513,7 @@ public static string Script0024 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0025 */
+        ///   Recherche une chaîne localisée semblable à /* Script0025 */
         ///
         ///throw new Exception(&quot;Exception for test&quot;);.
         /// </summary>
@@ -524,7 +524,7 @@ public static string Script0025 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0026 */
+        ///   Recherche une chaîne localisée semblable à /* Script0026 */
         ///
         ///varçÿ = &quot;A value in diactitic varçÿ&quot;;
         ///
@@ -539,7 +539,7 @@ public static string Script0026 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0027 */
+        ///   Recherche une chaîne localisée semblable à /* Script0027 */
         ///
         ///test = new áàâãåǎăāąæéèêëěēĕėęěìíîïīĭįĳóôõöōŏőøðœùúûüǔũūŭůűųýþÿŷıćĉċčçďđĝğġģĥħĵķĺļľŀłńņňŋñŕŗřśŝşšţťŧŵźżžÁÀÂÃÅǍĂĀĄÆÉÈÊËĚĒĔĖĘĚÌÍÎÏĪĬĮĲÓÔÕÖŌŎŐØÐŒÙÚÛÜǓŨŪŬŮŰŲÝÞŸŶIĆĈĊČÇĎĐĜĞĠĢĤĦĴĶĹĻĽĿŁŃŅŇŊÑŔŖŘŚŜŞŠŢŤŦŴŹŻŽß();
         ///
@@ -552,7 +552,7 @@ public static string Script0027 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0028 */
+        ///   Recherche une chaîne localisée semblable à /* Script0028 */
         ///
         ///x = 5;
         ///y = 0;
@@ -582,7 +582,7 @@ public static string Script0028 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0029 */
+        ///   Recherche une chaîne localisée semblable à /* Script0029 */
         ///
         ///x = 5;
         ///y = 0;
@@ -609,7 +609,7 @@ public static string Script0029 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0030 */
+        ///   Recherche une chaîne localisée semblable à /* Script0030 */
         ///
         ///x = 5;
         ///y = 0;
@@ -635,7 +635,7 @@ public static string Script0030 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0031 */
+        ///   Recherche une chaîne localisée semblable à /* Script0031 */
         ///
         ///x = 5;
         ///y = 0;
@@ -669,7 +669,7 @@ public static string Script0031 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0032 */
+        ///   Recherche une chaîne localisée semblable à /* Script0032 */
         ///
         ///c = 0;
         ///f = false;
@@ -700,7 +700,7 @@ public static string Script0032 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0033 */
+        ///   Recherche une chaîne localisée semblable à /* Script0033 */
         ///
         ///array = Array.CreateInstance(typeof(int), 3);
         ///array[1] = 5;
@@ -713,7 +713,7 @@ public static string Script0033 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0034 */
+        ///   Recherche une chaîne localisée semblable à /* Script0034 */
         ///
         ///array = new int[3];
         ///array[1] = 5;
@@ -726,7 +726,7 @@ public static string Script0034 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0035 */
+        ///   Recherche une chaîne localisée semblable à /* Script0035 */
         ///
         ///array = new int[] {1, 2, 3};
         ///array.Json;.
@@ -738,7 +738,7 @@ public static string Script0035 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0036 */
+        ///   Recherche une chaîne localisée semblable à /* Script0036 */
         ///
         ///array = new int[3] {1, 2, 3};
         ///array.Json;.
@@ -750,7 +750,7 @@ public static string Script0036 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0037 */
+        ///   Recherche une chaîne localisée semblable à /* Script0037 */
         ///
         ///test = &quot;\&quot;&quot; ;.
         /// </summary>
@@ -761,7 +761,7 @@ public static string Script0037 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0038 */
+        ///   Recherche une chaîne localisée semblable à /* Script0038 */
         ///
         ///xmlTagRegexPattern = &quot;(?&lt;begining&gt;[&lt;]tag\\s+id\\s*[=]\\s*\&quot;A.Id.For.The_Tag[^\&quot;]*\&quot;\\s*version\\s*[=]\\s*\&quot;)(?&lt;version&gt;[^\&quot;]*)&quot;;.
         /// </summary>
@@ -772,7 +772,7 @@ public static string Script0038 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0039 */
+        ///   Recherche une chaîne localisée semblable à /* Script0039 */
         ///
         ///xmlTagRegexPattern = $&quot;(?&lt;begining&gt;[&lt;]tag\\s+id\\s*[=]\\s*{&apos;&quot;&apos;}A.Id.For.The_Tag[^{&apos;&quot;&apos;}]*{&apos;&quot;&apos;}\\s*version\\s*[=]\\s*{&apos;&quot;&apos;})(?&lt;version&gt;[^{&apos;&quot;&apos;}]*)&quot;;.
         /// </summary>
@@ -783,7 +783,7 @@ public static string Script0039 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0040 */
+        ///   Recherche une chaîne localisée semblable à /* Script0040 */
         ///
         ///xmlTagRegexPattern = $&quot;(?&lt;begining&gt;[&lt;]tag\\s+id\\s*[=]\\s*{&quot;\&quot;&quot;}A.Id.For.The_Tag[^{&quot;\&quot;&quot;}]*{&quot;\&quot;&quot;}\\s*version\\s*[=]\\s*{&quot;\&quot;&quot;})(?&lt;version&gt;[^{&quot;\&quot;&quot;}]*)&quot;;.
         /// </summary>
@@ -794,7 +794,7 @@ public static string Script0040 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0041 */
+        ///   Recherche une chaîne localisée semblable à /* Script0041 */
         ///
         ///xmlTagRegexPattern = $@&quot;(?&lt;begining&gt;[&lt;]tag\s+id\s*[=]\s*{&quot;\&quot;&quot;}A.Id.For.The_Tag[^{&quot;\&quot;&quot;}]*{&quot;\&quot;&quot;}\s*version\s*[=]\s*{&quot;\&quot;&quot;})(?&lt;version&gt;[^{&quot;\&quot;&quot;}]*)&quot;;.
         /// </summary>
@@ -805,7 +805,7 @@ public static string Script0041 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0042 */
+        ///   Recherche une chaîne localisée semblable à /* Script0042 */
         ///
         ///doubleQuoteChar = &apos;&quot;&apos;;.
         /// </summary>
@@ -816,7 +816,7 @@ public static string Script0042 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0043 */
+        ///   Recherche une chaîne localisée semblable à /* Script0043 */
         ///
         ///doubleQuoteString = $&quot;{&apos;&quot;&apos;}&quot;;.
         /// </summary>
@@ -827,7 +827,7 @@ public static string Script0043 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0044 */
+        ///   Recherche une chaîne localisée semblable à /* Script0044 */
         ///
         ///xmlTagRegexPattern = $@&quot;{ &apos;&quot;&apos; }&quot;;.
         /// </summary>
@@ -838,7 +838,7 @@ public static string Script0044 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0045 */
+        ///   Recherche une chaîne localisée semblable à /* Script0045 */
         ///
         ///xmlTagRegexPattern = $@&quot;(?&lt;begining&gt;[&lt;]tag\s+id\s*[=]\s*{&apos;&quot;&apos;}A.Id.For.The_Tag[^{&apos;&quot;&apos;}]*{&apos;&quot;&apos;}\s*version\s*[=]\s*{&apos;&quot;&apos;})(?&lt;version&gt;[^{&apos;&quot;&apos;}]*)&quot;;.
         /// </summary>
@@ -849,7 +849,7 @@ public static string Script0045 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0046 */
+        ///   Recherche une chaîne localisée semblable à /* Script0046 */
         ///
         ///xmlTagRegexPattern = $@&quot;(?&lt;begining&gt;[&lt;]tag\s+id\s*[=]\s*{ &apos;&quot;&apos; }A.Id.For.The_Tag[^{ &apos;&quot;&apos; }]*{ &apos;&quot;&apos; }\s*version\s*[=]\s*{ &apos;&quot;&apos; })(?&lt;version&gt;[^{ &apos;&quot;&apos; }]*)&quot;;.
         /// </summary>
@@ -860,7 +860,7 @@ public static string Script0046 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0047 */
+        ///   Recherche une chaîne localisée semblable à /* Script0047 */
         ///x = 5;
         ///y = ++x;
         ///$&quot;x:{x} y:{y}&quot;;.
@@ -872,7 +872,7 @@ public static string Script0047 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0048 */
+        ///   Recherche une chaîne localisée semblable à /* Script0048 */
         ///x = 5;
         ///y = --x;
         ///$&quot;x:{x} y:{y}&quot;;.
@@ -884,7 +884,7 @@ public static string Script0048 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0049 */
+        ///   Recherche une chaîne localisée semblable à /* Script0049 */
         ///P1 = 5;
         ///P2 = 6;
         ///P1 &lt; 1 &amp;&amp; P2 &gt; 3;.
@@ -896,7 +896,7 @@ public static string Script0049 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0050 */
+        ///   Recherche une chaîne localisée semblable à /* Script0050 */
         ///Json = &quot;hye&quot;;
         ///
         ///x = new ExpandoObject();
@@ -912,7 +912,7 @@ public static string Script0050 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0051 */
+        ///   Recherche une chaîne localisée semblable à /* Script0051 */
         ///x = new ExpandoObject()
         ///{
         ///	Hello = 3,
@@ -928,7 +928,7 @@ public static string Script0051 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0052 */
+        ///   Recherche une chaîne localisée semblable à /* Script0052 */
         ///
         ///Json = &quot;Yes&quot;;
         ///y = 3;
@@ -948,7 +948,7 @@ public static string Script0052 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0053 */
+        ///   Recherche une chaîne localisée semblable à /* Script0053 */
         ///x = new 
         ///{
         ///	Hello = 3,
@@ -964,7 +964,7 @@ public static string Script0053 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0054 */
+        ///   Recherche une chaîne localisée semblable à /* Script0054 */
         ///myStruct.myIntvalue = 3;
         ///myStruct.myStringValue = &quot;Test&quot;;
         ///
@@ -977,7 +977,7 @@ public static string Script0054 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0055 */
+        ///   Recherche une chaîne localisée semblable à /* Script0055 */
         ///otherStruct.AnOtherIntValue = 5;
         ///
         ///otherStruct.nestedStruct = new StructForTest1()
@@ -997,7 +997,7 @@ public static string Script0055 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0056 */
+        ///   Recherche une chaîne localisée semblable à /* Script0056 */
         ///classStructContainer = new ClassStructContainer()
         ///{
         ///    nestedStructField = new StructForTest1()
@@ -1018,7 +1018,7 @@ public static string Script0056 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0057 */
+        ///   Recherche une chaîne localisée semblable à /* Script0057 */
         ///classStructContainer = new ClassStructContainer()
         ///{
         ///    nestedStructField2 = new StructForTest3()
@@ -1040,7 +1040,7 @@ public static string Script0057 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0058 */
+        ///   Recherche une chaîne localisée semblable à /* Script0058 */
         ///classStructContainer = new ClassStructContainer()
         ///{
         ///    NestedStructProperty = new StructForTest1()
@@ -1063,7 +1063,7 @@ public static string Script0058 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0059 */
+        ///   Recherche une chaîne localisée semblable à /* Script0059 */
         ///otherStruct = new StructForTest4();
         ///
         ///otherStruct.AnOtherIntValue = 5;
@@ -1085,7 +1085,7 @@ public static string Script0059 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0060 */
+        ///   Recherche une chaîne localisée semblable à /* Script0060 */
         ///var x = 4;
         ///var textVar = &quot;A text for {0} test&quot;;
         ///
@@ -1098,7 +1098,7 @@ public static string Script0060 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0061 */
+        ///   Recherche une chaîne localisée semblable à /* Script0061 */
         ///var x = new List&lt;int&gt; {1,2,3,4};
         ///x.Json.
         /// </summary>
@@ -1109,7 +1109,7 @@ public static string Script0061 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0062 */
+        ///   Recherche une chaîne localisée semblable à /* Script0062 */
         ///var x = new List&lt;int&gt; {1,2,3,4}.
         /// </summary>
         public static string Script0062 {
@@ -1119,7 +1119,7 @@ public static string Script0062 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0063 */
+        ///   Recherche une chaîne localisée semblable à /* Script0063 */
         ///int x = 3;
         ///
         ///return x + 2;.
@@ -1131,7 +1131,7 @@ public static string Script0063 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0064 */
+        ///   Recherche une chaîne localisée semblable à /* Script0064 */
         ///float x = 3.5f;
         ///
         ///return x + 2;.
@@ -1143,7 +1143,7 @@ public static string Script0064 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0065 */
+        ///   Recherche une chaîne localisée semblable à /* Script0065 */
         ///dynamic x = 6;
         ///
         ///return x + 2;.
@@ -1155,7 +1155,7 @@ public static string Script0065 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0066 */
+        ///   Recherche une chaîne localisée semblable à /* Script0066 */
         ///string test = &quot;&quot;;
         ///
         ///for(int x = 0; x &lt; 5; x++)
@@ -1172,7 +1172,7 @@ public static string Script0066 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0067 */
+        ///   Recherche une chaîne localisée semblable à /* Script0067 */
         ///List&lt;int&gt; myList = new List&lt;int&gt;{1, 2, 3, 4};
         ///
         ///myList.Json;.
@@ -1184,7 +1184,7 @@ public static string Script0067 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0068 */
+        ///   Recherche une chaîne localisée semblable à /* Script0068 */
         ///List&lt;int&gt; myList = new List&lt;int&gt;{1, 2, 3, 4};
         ///
         ///int a = 0;
@@ -1200,7 +1200,7 @@ public static string Script0068 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0069 */
+        ///   Recherche une chaîne localisée semblable à /* Script0069 */
         ///List&lt;int&gt; myList = new List&lt;int&gt;{1, 2, 3, 4};
         ///
         ///string text = &quot;&quot;;
@@ -1219,7 +1219,7 @@ public static string Script0069 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0070 */
+        ///   Recherche une chaîne localisée semblable à /* Script0070 */
         ///var e = new Exception(&quot;Must not be thrown&quot;);
         ///
         ///return 1+2;.
@@ -1231,7 +1231,7 @@ public static string Script0070 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0071 */
+        ///   Recherche une chaîne localisée semblable à /* Script0071 */
         ///var myVar = null;
         ///
         ///myVar ??= &quot;First Null-coalescing assignation&quot;;
@@ -1246,7 +1246,7 @@ public static string Script0071 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0072 */
+        ///   Recherche une chaîne localisée semblable à /* Script0072 */
         ///var myVar = 8;
         ///
         ///return( myVar );.
@@ -1258,7 +1258,7 @@ public static string Script0072 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0073 */
+        ///   Recherche une chaîne localisée semblable à /* Script0073 */
         ///var myVar = 8;
         ///
         ///returnmyVar;.
@@ -1270,7 +1270,7 @@ public static string Script0073 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0074 */
+        ///   Recherche une chaîne localisée semblable à /* Script0074 */
         ///var myVar = 8
         ///
         ///return myVar.
@@ -1282,7 +1282,7 @@ public static string Script0074 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0075 [infos]*/
+        ///   Recherche une chaîne localisée semblable à /* Script0075 [infos]*/
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7: 
@@ -1297,7 +1297,7 @@ public static string Script0075 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0076 [infos]*/
+        ///   Recherche une chaîne localisée semblable à /* Script0076 [infos]*/
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7:
@@ -1314,7 +1314,7 @@ public static string Script0076 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0077 [infos]*/
+        ///   Recherche une chaîne localisée semblable à /* Script0077 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7): 
@@ -1329,7 +1329,7 @@ public static string Script0077 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0078 [infos]*/
+        ///   Recherche une chaîne localisée semblable à /* Script0078 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7):
@@ -1346,7 +1346,7 @@ public static string Script0078 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0079 [infos]*/
+        ///   Recherche une chaîne localisée semblable à /* Script0079 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7) 
@@ -1361,7 +1361,7 @@ public static string Script0079 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0080 [infos]*/
+        ///   Recherche une chaîne localisée semblable à /* Script0080 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7)
@@ -1378,7 +1378,7 @@ public static string Script0080 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0081 [infos]*/
+        ///   Recherche une chaîne localisée semblable à /* Script0081 [infos]*/
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7)  : 
@@ -1393,7 +1393,7 @@ public static string Script0081 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0082 */
+        ///   Recherche une chaîne localisée semblable à /* Script0082 */
         ///var myVar = 8;
         ///
         ///if|myVar &gt; 7| 
@@ -1408,7 +1408,7 @@ public static string Script0082 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0083 */
+        ///   Recherche une chaîne localisée semblable à /* Script0083 */
         ///var myVar = 8;
         ///
         ///if |myVar &gt; 7|
@@ -1425,7 +1425,7 @@ public static string Script0083 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0084 */
+        ///   Recherche une chaîne localisée semblable à /* Script0084 */
         ///var myVar = 8;
         ///
         ///if {myVar &gt; 7}
@@ -1440,7 +1440,7 @@ public static string Script0084 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0083 */
+        ///   Recherche une chaîne localisée semblable à /* Script0083 */
         ///var myVar = 8;
         ///
         ///if {myVar &gt; 7}
@@ -1457,7 +1457,7 @@ public static string Script0085 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0086 */
+        ///   Recherche une chaîne localisée semblable à /* Script0086 */
         ///var myVar = 8;
         ///
         ///if &lt;[myVar &gt; 7]&gt;
@@ -1472,7 +1472,7 @@ public static string Script0086 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0087 */
+        ///   Recherche une chaîne localisée semblable à /* Script0087 */
         ///var myVar = 8;
         ///
         ///if &lt;[myVar &gt; 7]&gt;
@@ -1489,7 +1489,7 @@ public static string Script0087 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0088 */
+        ///   Recherche une chaîne localisée semblable à /* Script0088 */
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7 =&gt;
@@ -1504,7 +1504,7 @@ public static string Script0088 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0089 */
+        ///   Recherche une chaîne localisée semblable à /* Script0089 */
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7 =&gt;
@@ -1521,7 +1521,7 @@ public static string Script0089 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0090 */
+        ///   Recherche une chaîne localisée semblable à /* Script0090 */
         ///var myVar = 8;
         ///
         ///if (myVar &gt; 7)
@@ -1538,7 +1538,7 @@ public static string Script0090 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0091 */
+        ///   Recherche une chaîne localisée semblable à /* Script0091 */
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7 then
@@ -1555,7 +1555,7 @@ public static string Script0091 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0092 */
+        ///   Recherche une chaîne localisée semblable à /* Script0092 */
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7 then
@@ -1573,7 +1573,7 @@ public static string Script0092 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0093 */
+        ///   Recherche une chaîne localisée semblable à /* Script0093 */
         ///var myVar = 8;
         ///
         ///if myVar &gt; 7 then
@@ -1591,7 +1591,7 @@ public static string Script0093 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0094 */
+        ///   Recherche une chaîne localisée semblable à /* Script0094 */
         ///myList = -&gt; List&lt;int&gt;()
         ///{
         ///	2
@@ -1606,7 +1606,7 @@ public static string Script0094 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0095 */
+        ///   Recherche une chaîne localisée semblable à /* Script0095 */
         ///myList = create List&lt;int&gt;()
         ///{
         ///	2
@@ -1626,7 +1626,7 @@ public static string Script0095 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0096 indentation with 4 spaces*/
+        ///   Recherche une chaîne localisée semblable à /* Script0096 indentation with 4 spaces*/
         ///var myVar = 1;
         ///var myVar2 = 2;
         ///
@@ -1645,7 +1645,7 @@ public static string Script0096 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0097 indentation with tab*/
+        ///   Recherche une chaîne localisée semblable à /* Script0097 indentation with tab*/
         ///var myVar = 1;
         ///var myVar2 = 2;
         ///
@@ -1664,7 +1664,7 @@ public static string Script0097 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0098 indentation with 2 spaces*/
+        ///   Recherche une chaîne localisée semblable à /* Script0098 indentation with 2 spaces*/
         ///var myVar = 1;
         ///var myVar2 = 2;
         ///
@@ -1683,12 +1683,14 @@ public static string Script0098 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0099 python like syntax*/
+        ///   Recherche une chaîne localisée semblable à /* Script0099 python like syntax*/
         ///myVar = 1
         ///myVar2 = 2
         ///
         ///while myVar &lt; 20:
+        ///
         ///    myVar++
+        ///
         ///    if myVar == 7:
         ///        myVar = 21
         ///        myVar2++
@@ -1702,7 +1704,7 @@ public static string Script0099 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0100 */
+        ///   Recherche une chaîne localisée semblable à /* Script0100 */
         ///var dictionary = new Dictionary&lt;string, object&gt;();
         ///dictionary.Add(&quot;x&quot;, 5);
         ///object number = null;
@@ -1717,7 +1719,7 @@ public static string Script0100 {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to /* Script0101 */
+        ///   Recherche une chaîne localisée semblable à /* Script0101 */
         ///var dictionary = new Dictionary&lt;string, object&gt;();
         ///dictionary.Add(&quot;x&quot;, 5);
         ///object number = 10;
@@ -1730,5 +1732,20 @@ public static string Script0101 {
                 return ResourceManager.GetString("Script0101", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Recherche une chaîne localisée semblable à /* Script0102 */
+        ///var obj = { 
+        ///	&quot;AnIntProp&quot;: 5,
+        ///	&quot;OtherInt&quot;: 8
+        ///};
+        ///
+        ///return obj.AnIntProp + obj.OtherInt;.
+        /// </summary>
+        public static string Script0102 {
+            get {
+                return ResourceManager.GetString("Script0102", resourceCulture);
+            }
+        }
     }
 }
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
index 83cfb96..60704a9 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources.resx
@@ -421,4 +421,7 @@
   <data name="Script0101" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>resources\script0101.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
+  <data name="Script0102" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>resources\script0102.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
 </root>
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0102.txt b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0102.txt
new file mode 100644
index 0000000..453e18f
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator.Tests/Resources/Script0102.txt
@@ -0,0 +1,7 @@
+﻿/* Script0102 */
+var obj = { 
+	"AnIntProp": 5,
+	"OtherInt": 8
+};
+
+return obj.AnIntProp + obj.OtherInt;
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index f390894..9447c3f 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -58,6 +58,7 @@ public partial class ExpressionEvaluator
 
         // Depending on OptionInlineNamespacesEvaluationActive. Initialized in constructor
         protected Regex instanceCreationKeywordRegex = new Regex(@"^new(?>\s*)((?<isAnonymous>[{{])|((?<name>[\p{L}_][\p{L}_0-9\.]*)(?>\s*)(?<isgeneric>[<](?>[^<>]+|(?<gentag>[<])|(?<-gentag>[>]))*(?(gentag)(?!))[>])?(?>\s*)((?<isfunction>[(])|(?<isArray>\[)|(?<isInit>[{{]))?))", RegexOptions.Compiled);
+        protected Regex initializationPropertyRegex = new Regex(@"^[\p{L}_][\p{L}_0-9]*", RegexOptions.Compiled);
         protected Regex castRegex = new Regex(@"^\((?>\s*)(?<typeName>[\p{L}_][\p{L}_0-9\.\[\]<>]*[?]?)(?>\s*)\)", RegexOptions.Compiled);
 
         // To remove comments in scripts based on https://stackoverflow.com/questions/3524317/regex-to-strip-line-comments-from-c-sharp/3524689#3524689
@@ -896,7 +897,21 @@ public string[] StatementTerminalPunctuators
             /// <para>Default value : <c>","</c></para>
             /// Warning must to be changed if OptionNumberParsingDecimalSeparator = "," otherwise it will create conflicts
             /// </summary>
-            public string InitializersSeparator { get; set; } = ",";
+            public string InitializerSeparator { get; set; } = ",";
+
+            /// <summary>
+            /// To Replace or add separators for object initialization assignation
+            /// To separate the Property/Indexing part of the value evaluation part
+            /// <para>Default value : <c>{"="}</c></para>
+            /// </summary>
+            public string[] InitializerPropertyValueSeparators { get; set; } = new[] { "=" };
+
+            /// <summary>
+            /// If <c>true</c>, allow to use a string in place of the property name in initializers<para/>
+            /// If <c>false</c>, only allow for direct property name or indexing in initializers
+            /// <para>Default value : <c>false</c></para>
+            /// </summary>
+            public bool InitializerAllowStringForProperties { get; set; }
 
             /// <summary>
             /// The separator that separate each expression in block keyword's head
@@ -1365,8 +1380,7 @@ protected virtual void Init()
 
         /// <summary>
         /// Evaluate a script (multiple expressions separated by semicolon)
-        /// Support Assignation with [=] (for simple variable write in the Variables dictionary)
-        /// support also if, else if, else while and for keywords
+        /// Support assignation and some block keywords<para/>
         /// </summary>
         /// <typeparam name="T">The type in which to cast the result of the expression</typeparam>
         /// <param name="script">the script to evaluate</param>
@@ -1378,8 +1392,7 @@ public virtual T ScriptEvaluate<T>(string script)
 
         /// <summary>
         /// Evaluate a script (multiple expressions separated by semicolon)
-        /// Support Assignation with [=] (for simple variable write in the Variables dictionary)
-        /// support also if, else if, else while and for keywords
+        /// Support assignation and some block keywords<para/>
         /// </summary>
         /// <param name="script">the script to evaluate</param>
         /// <returns>The result of the last evaluated expression</returns>
@@ -1782,7 +1795,7 @@ public T Evaluate<T>(string expression)
         {
             EvaluateCast,
             EvaluateNumber,
-            EvaluateInstanceCreationWithNewKeyword,
+            EvaluateInstanceCreation,
             EvaluateVarOrFunc,
             EvaluateOperators,
             EvaluateChar,
@@ -2116,7 +2129,7 @@ protected virtual bool EvaluateNumber(string expression, Stack<object> stack, re
             }
         }
 
-        protected virtual bool EvaluateInstanceCreationWithNewKeyword(string expression, Stack<object> stack, ref int i)
+        protected virtual bool EvaluateInstanceCreation(string expression, Stack<object> stack, ref int i)
         {
             if (!OptionsFunctionalities.NewKeywordEvaluationActive)
                 return false;
@@ -2134,17 +2147,50 @@ void InitSimpleObject(object element, List<string> initArgs)
                     Variables[variable] = element;
                     try
                     {
+                        Match match = null;
+
                         initArgs.ForEach(subExpr =>
                         {
-                            if (subExpr.Contains("="))
+                            string trimmedSubExpr = subExpr.TrimStart();
+                            string PropPart = string.Empty;
+
+                            int pos = 0;
+
+                            if((match = initializationPropertyRegex.Match(trimmedSubExpr)).Success)
                             {
-                                string trimmedSubExpr = subExpr.TrimStart();
+                                pos += match.Length;
+                                PropPart = $"{variable}.{match.Value}";
+                            }
+                            else if(trimmedSubExpr.StartsWith("["))
+                            {
+                                pos++;
+                                GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(trimmedSubExpr, ref pos, false, startToken:"[", endToken:"]");
+                                pos++;
+                                PropPart = $"{variable}{trimmedSubExpr.Substring(0, pos)}";
+                            }
+                            else if(OptionsSyntaxRules.InitializerAllowStringForProperties
+                            && (match = stringBeginningRegex.Match(trimmedSubExpr)).Success)
+                            {
+                                string innerString = match.Value + GetCodeUntilEndOfString(trimmedSubExpr.Substring(match.Length), match);
+                                pos += innerString.Length;
+                                string propName = Evaluate<string>(innerString);
+                                PropPart = $"{variable}.{propName}";
+                            }
+                            else
+                            {
+                                throw new ExpressionEvaluatorSyntaxErrorException($"The syntax for initialization is wrong in [{subExpr.Trim()}].");
+                            }
 
-                                Evaluate($"{variable}{(trimmedSubExpr.StartsWith("[") ? string.Empty : ".")}{trimmedSubExpr}");
+                            trimmedSubExpr = trimmedSubExpr.Substring(pos).TrimStart();
+                            string separator = OptionsSyntaxRules.InitializerPropertyValueSeparators.FirstOrDefault(sep => trimmedSubExpr.StartsWith(sep, StringComparisonForCasing));
+
+                            if(separator != null)
+                            {
+                                Evaluate($"{PropPart}={trimmedSubExpr.Substring(separator.Length)}");
                             }
                             else
                             {
-                                throw new ExpressionEvaluatorSyntaxErrorException($"A '=' char is missing in [{subExpr}]. It is in a object initializer. It must contains one.");
+                                throw new ExpressionEvaluatorSyntaxErrorException($"One of the following token [{string.Join(",", OptionsSyntaxRules.InitializerPropertyValueSeparators.Select(t => "\"" + t + "\""))}] is missing in [{subExpr.Trim()}]. It is in a object initializer. It must contains one.");
                             }
                         });
                     }
@@ -2160,7 +2206,7 @@ void InitSimpleObject(object element, List<string> initArgs)
                 {
                     object element = new ExpandoObject();
 
-                    List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
+                    List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializerSeparator, "{", "}");
 
                     InitSimpleObject(element, initArgs);
 
@@ -2195,7 +2241,7 @@ void Init(object element, List<string> initArgs)
                             {
                                 int subIndex = subExpr.IndexOf("{") + 1;
 
-                                List<string> subArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(subExpr, ref subIndex, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
+                                List<string> subArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(subExpr, ref subIndex, true, OptionsSyntaxRules.InitializerSeparator, "{", "}");
 
                                 if (subArgs.Count == 2)
                                 {
@@ -2230,7 +2276,7 @@ void Init(object element, List<string> initArgs)
                         {
                             i += blockBeginningMatch.Length;
 
-                            List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
+                            List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializerSeparator, "{", "}");
 
                             Init(element, initArgs);
                         }
@@ -2245,7 +2291,7 @@ void Init(object element, List<string> initArgs)
                     {
                         object element = Activator.CreateInstance(type, new object[0]);
 
-                        List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
+                        List<string> initArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializerSeparator, "{", "}");
 
                         Init(element, initArgs);
 
@@ -2253,7 +2299,7 @@ void Init(object element, List<string> initArgs)
                     }
                     else if (instanceCreationMatch.Groups["isArray"].Success)
                     {
-                        List<string> arrayArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "[", "]");
+                        List<string> arrayArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializerSeparator, "[", "]");
                         i++;
                         Array array = null;
 
@@ -2268,7 +2314,7 @@ void Init(object element, List<string> initArgs)
                         {
                             i += initInNewBeginningMatch.Length;
 
-                            List<string> arrayElements = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializersSeparator, "{", "}");
+                            List<string> arrayElements = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, OptionsSyntaxRules.InitializerSeparator, "{", "}");
 
                             if (array == null)
                                 array = Array.CreateInstance(type, arrayElements.Count);

From b494a15b7c36e22c52a2b2eb1c93b5e7e3f00eee Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 25 May 2021 13:08:35 +0200
Subject: [PATCH 40/48] JsonSyntax CheckBox In TryWindow

---
 TryWindow/MainWindow.xaml    | 3 +++
 TryWindow/MainWindow.xaml.cs | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/TryWindow/MainWindow.xaml b/TryWindow/MainWindow.xaml
index 5108706..af91528 100644
--- a/TryWindow/MainWindow.xaml
+++ b/TryWindow/MainWindow.xaml
@@ -31,6 +31,9 @@
                 <CheckBox x:Name="CaseSensitiveCheckBox"
                           Content="Case sensitive"
                           IsChecked="True"/>
+                <CheckBox x:Name="JsonSyntaxCheckBox"
+                          Content="Allow Json syntax to init objects"
+                          IsChecked="True" />
             </WrapPanel>
             
             <Button x:Name="CalculateButton" Content="_Execute" IsDefault="True" Click="CalculateButton_Click" />
diff --git a/TryWindow/MainWindow.xaml.cs b/TryWindow/MainWindow.xaml.cs
index 0056e4c..35fefad 100644
--- a/TryWindow/MainWindow.xaml.cs
+++ b/TryWindow/MainWindow.xaml.cs
@@ -45,6 +45,13 @@ private async void CalculateButton_Click(object sender, RoutedEventArgs e)
                 OptionCaseSensitiveEvaluationActive = CaseSensitiveCheckBox.IsChecked.GetValueOrDefault()
             };
 
+            if(JsonSyntaxCheckBox.IsChecked ?? false)
+            {
+                evaluator.OptionsSyntaxRules.IsNewKeywordForAnonymousExpandoObjectOptional = true;
+                evaluator.OptionsSyntaxRules.InitializerPropertyValueSeparators = new[] { "=", ":" };
+                evaluator.OptionsSyntaxRules.InitializerAllowStringForProperties = true;
+            }
+
             if (UseCachesCheckbox.IsChecked ?? false)
                 evaluator.CacheTypesResolutions = true;
 

From 83b8f54d2d09c9be9d202188947db0696eee4b08 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 25 May 2021 16:09:33 +0200
Subject: [PATCH 41/48] #94 simplified collection syntax part looks OK

---
 .../ExpressionEvaluatorTests.cs               | 14 +++++
 .../ExpressionEvaluator.cs                    | 58 ++++++++++++++++++-
 TryWindow/MainWindow.xaml                     |  2 +-
 3 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
index 3d07c4f..96bc47c 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
@@ -2549,6 +2549,20 @@ ExpressionEvaluator evaluatorForMethodArgs()
                     .SetCategory("Anonymous")
                     .SetCategory("InitializerAllowStringForProperties");
 
+                yield return new TestCaseData(new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            AllowSimplifiedCollectionSyntax = true
+                        }
+                    }
+                    , "[3,2,6,10].Length"
+                    , null)
+                    .Returns(4)
+                    .SetCategory("ExpandoObject")
+                    .SetCategory("Anonymous")
+                    .SetCategory("InitializerAllowStringForProperties");
+
                 #endregion
 
                 #region Issues/Bug resolution
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index 9447c3f..e6807b3 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -913,6 +913,32 @@ public string[] StatementTerminalPunctuators
             /// </summary>
             public bool InitializerAllowStringForProperties { get; set; }
 
+            /// <summary>
+            /// If <c>true</c> allow a simplified syntax to create a collection<para/>
+            /// Example : <c>var collection = [1, 2, 3]; // collection[1] -> 2</c><para/>
+            /// The type of the collection that is created with this syntax is defined with the linked option
+            /// If <c>false</c> simplified syntax for coolection is unactive
+            /// <para>Default value : <c>false</c></para>
+            /// </summary>
+            public bool AllowSimplifiedCollectionSyntax { get; set; }
+
+            /// <summary>
+            /// Specify Which type of collection is create when symplified collection syntax is used.<para/>
+            /// <list type="table">
+            ///    <item>
+            ///        <term>Array</term>
+            ///        <description><c>object[]</c></description>
+            ///    </item>
+            ///    <item>
+            ///        <term>List</term>
+            ///        <description><c>List&lt;object&gt;</c></description>
+            ///    </item>
+            ///</list>
+            /// Only effective if AllowSimplifiedCollectionSyntax is <c>true</c>.<para />
+            /// <para>Default value : <c>Array</c></para>
+            /// </summary>
+            public SimplifiedCollectionMode SimplifiedCollectionMode { get; set; }
+
             /// <summary>
             /// The separator that separate each expression in block keyword's head
             /// <para>Default value : <c>";"</c></para>
@@ -1800,6 +1826,7 @@ public T Evaluate<T>(string expression)
             EvaluateOperators,
             EvaluateChar,
             EvaluateParenthis,
+            EvaluateSimplifiedCollection,
             EvaluateIndexing,
             EvaluateString,
             EvaluateTernaryConditionalOperator,
@@ -2182,7 +2209,7 @@ void InitSimpleObject(object element, List<string> initArgs)
                             }
 
                             trimmedSubExpr = trimmedSubExpr.Substring(pos).TrimStart();
-                            string separator = OptionsSyntaxRules.InitializerPropertyValueSeparators.FirstOrDefault(sep => trimmedSubExpr.StartsWith(sep, StringComparisonForCasing));
+                            string separator = Array.Find(OptionsSyntaxRules.InitializerPropertyValueSeparators, sep => trimmedSubExpr.StartsWith(sep, StringComparisonForCasing));
 
                             if(separator != null)
                             {
@@ -3213,6 +3240,29 @@ protected virtual void CorrectStackWithUnaryPlusOrMinusBeforeParenthisIfNecessar
             }
         }
 
+        protected virtual bool EvaluateSimplifiedCollection(string expression, Stack<object> stack, ref int i)
+        {
+            if(OptionsSyntaxRules.AllowSimplifiedCollectionSyntax
+                && stack.Count == 0
+                && expression.Substring(i).StartsWith("["))
+            {
+                i++;
+                IEnumerable<object> valueArgs = GetExpressionsBetweenParenthesesOrOtherImbricableBrackets(expression, ref i, true, startToken: "[", endToken: "]")
+                    .Select(subExp => Evaluate(subExp));
+
+                if (OptionsSyntaxRules.SimplifiedCollectionMode == SimplifiedCollectionMode.List)
+                    stack.Push(valueArgs.ToList());
+                else
+                    stack.Push(valueArgs.ToArray());
+
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
         protected virtual bool EvaluateIndexing(string expression, Stack<object> stack, ref int i)
         {
             if (!OptionsFunctionalities.IndexingActive)
@@ -4860,6 +4910,12 @@ public enum BlockIndentation
         Spaces
     }
 
+    public enum SimplifiedCollectionMode
+    {
+        Array,
+        List
+    }
+
     #endregion
 
     #region ExpressionEvaluator linked public classes (specific Exceptions, EventArgs and Operators)
diff --git a/TryWindow/MainWindow.xaml b/TryWindow/MainWindow.xaml
index af91528..8adceb6 100644
--- a/TryWindow/MainWindow.xaml
+++ b/TryWindow/MainWindow.xaml
@@ -7,7 +7,7 @@
         xmlns:ae="http://icsharpcode.net/sharpdevelop/avalonedit"
         Closing="Window_Closing"
         mc:Ignorable="d"
-        Title="Expression Evaluate" Width="400" Height="320">
+        Title="Expression Evaluate" Width="476" Height="320">
     <DockPanel>
 
         <StackPanel DockPanel.Dock="Bottom">

From ae2b54f8036e2eb0941d552756acf2e6b799c560 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 25 May 2021 16:13:52 +0200
Subject: [PATCH 42/48] A bit more tests

---
 .../ExpressionEvaluatorTests.cs               | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
index 96bc47c..82e96a1 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
@@ -2563,6 +2563,52 @@ ExpressionEvaluator evaluatorForMethodArgs()
                     .SetCategory("Anonymous")
                     .SetCategory("InitializerAllowStringForProperties");
 
+                yield return new TestCaseData(new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            AllowSimplifiedCollectionSyntax = true
+                        }
+                    }
+                    , "[3,2,6,10][2]"
+                    , null)
+                    .Returns(6)
+                    .SetCategory("ExpandoObject")
+                    .SetCategory("Anonymous")
+                    .SetCategory("InitializerAllowStringForProperties");
+
+                yield return new TestCaseData(new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            AllowSimplifiedCollectionSyntax = true,
+                            SimplifiedCollectionMode = SimplifiedCollectionMode.List
+                        }
+                    }
+                    , "[3,2,6,10].Count"
+                    , null)
+                    .Returns(4)
+                    .SetCategory("ExpandoObject")
+                    .SetCategory("Anonymous")
+                    .SetCategory("InitializerAllowStringForProperties")
+                    .SetCategory("SimplifiedCollectionMode");
+
+                yield return new TestCaseData(new ExpressionEvaluator()
+                    {
+                        OptionsSyntaxRules = new ExpressionEvaluator.SyntaxRules()
+                        {
+                            AllowSimplifiedCollectionSyntax = true,
+                            SimplifiedCollectionMode = SimplifiedCollectionMode.List
+                        }
+                    }
+                    , "[3,2,6,10][3]"
+                    , null)
+                    .Returns(10)
+                    .SetCategory("ExpandoObject")
+                    .SetCategory("Anonymous")
+                    .SetCategory("InitializerAllowStringForProperties")
+                    .SetCategory("SimplifiedCollectionMode");
+
                 #endregion
 
                 #region Issues/Bug resolution

From d2c9e2444bca6e6d69ed74135e38bbf5a8059867 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien?= <sebgeiser@gmail.com>
Date: Tue, 25 May 2021 17:50:31 +0200
Subject: [PATCH 43/48] Version 1.5.0-alpha0001

---
 .../CodingSeb.ExpressionEvaluator.csproj                  | 8 ++++----
 CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs      | 2 +-
 TryWindow/MainWindow.xaml                                 | 2 +-
 TryWindow/MainWindow.xaml.cs                              | 1 +
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj b/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
index fe84c56..95bbd5f 100644
--- a/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
+++ b/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
@@ -5,9 +5,9 @@
     <Product>CodingSeb.ExpressionEvaluator</Product>
     <Description>A Simple Math and Pseudo C# Expression Evaluator in One C# File. Can also execute small C# like scripts</Description>
     <Copyright>Copyright © Coding Seb 2017</Copyright>
-    <Version>1.4.29.0</Version>
-    <AssemblyVersion>1.4.29.0</AssemblyVersion>
-    <FileVersion>1.4.29.0</FileVersion>
+    <Version>1.5.0-alpha0001</Version>
+    <AssemblyVersion>1.5.0.0</AssemblyVersion>
+    <FileVersion>1.5.0.0</FileVersion>
     <OutputPath>bin\$(Configuration)\</OutputPath>
     <Authors>Coding Seb</Authors>
     <PackageId>CodingSeb.ExpressionEvaluator</PackageId>
@@ -19,7 +19,7 @@
     <PackageIconUrl>https://github.com/codingseb/ExpressionEvaluator/blob/master/Icon.png?raw=true</PackageIconUrl>
     <PackageIcon>Icon.png</PackageIcon>
     <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
-    <PackageReleaseNotes>* Add Multidimensional indexing management like myStuffToIndex[1,4]</PackageReleaseNotes>
+    <PackageReleaseNotes>* Some prerelease syntax customization features to test it live</PackageReleaseNotes>
     <PackageLicenseFile>LICENSE.md</PackageLicenseFile>
     <RepositoryUrl>https://github.com/codingseb/ExpressionEvaluator</RepositoryUrl>
   </PropertyGroup>
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index e6807b3..dfe3b21 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -1,6 +1,6 @@
 /******************************************************************************************************
     Title : ExpressionEvaluator (https://github.com/codingseb/ExpressionEvaluator)
-    Version : 1.4.29.0 
+    Version : 1.5.0.0 Alpha
     (if last digit (the forth) is not a zero, the version is an intermediate version and can be unstable)
 
     Author : Coding Seb
diff --git a/TryWindow/MainWindow.xaml b/TryWindow/MainWindow.xaml
index 8adceb6..11484b5 100644
--- a/TryWindow/MainWindow.xaml
+++ b/TryWindow/MainWindow.xaml
@@ -11,7 +11,7 @@
     <DockPanel>
 
         <StackPanel DockPanel.Dock="Bottom">
-            <DockPanel>
+            <DockPanel Margin="0,0,-0.4,0">
                 <Label DockPanel.Dock="Left" 
                        Content="Iterations"
                        Padding="2,0"/>
diff --git a/TryWindow/MainWindow.xaml.cs b/TryWindow/MainWindow.xaml.cs
index 35fefad..e467f3d 100644
--- a/TryWindow/MainWindow.xaml.cs
+++ b/TryWindow/MainWindow.xaml.cs
@@ -50,6 +50,7 @@ private async void CalculateButton_Click(object sender, RoutedEventArgs e)
                 evaluator.OptionsSyntaxRules.IsNewKeywordForAnonymousExpandoObjectOptional = true;
                 evaluator.OptionsSyntaxRules.InitializerPropertyValueSeparators = new[] { "=", ":" };
                 evaluator.OptionsSyntaxRules.InitializerAllowStringForProperties = true;
+                evaluator.OptionsSyntaxRules.AllowSimplifiedCollectionSyntax = true;
             }
 
             if (UseCachesCheckbox.IsChecked ?? false)

From 12ba6e205d1edccdd45ef718dfb57b7cb18642c1 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Wed, 2 Jun 2021 13:40:25 +0200
Subject: [PATCH 44/48] Some infos for alphas versions

---
 .../CodingSeb.ExpressionEvaluator.csproj                   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj b/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
index 95bbd5f..59ef74e 100644
--- a/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
+++ b/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
@@ -3,7 +3,9 @@
     <AssemblyTitle>CodingSeb.ExpressionEvaluator</AssemblyTitle>
     <Company>Coding Seb</Company>
     <Product>CodingSeb.ExpressionEvaluator</Product>
-    <Description>A Simple Math and Pseudo C# Expression Evaluator in One C# File. Can also execute small C# like scripts</Description>
+    <Description>A Simple Math and Pseudo C# Expression Evaluator
+Can also execute small C# like scripts.
+Syntax is easily customizable</Description>
     <Copyright>Copyright © Coding Seb 2017</Copyright>
     <Version>1.5.0-alpha0001</Version>
     <AssemblyVersion>1.5.0.0</AssemblyVersion>
@@ -19,7 +21,8 @@
     <PackageIconUrl>https://github.com/codingseb/ExpressionEvaluator/blob/master/Icon.png?raw=true</PackageIconUrl>
     <PackageIcon>Icon.png</PackageIcon>
     <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
-    <PackageReleaseNotes>* Some prerelease syntax customization features to test it live</PackageReleaseNotes>
+    <PackageReleaseNotes>* Some prerelease syntax customization features to test it live
+!!! Warning breaking changes !!!</PackageReleaseNotes>
     <PackageLicenseFile>LICENSE.md</PackageLicenseFile>
     <RepositoryUrl>https://github.com/codingseb/ExpressionEvaluator</RepositoryUrl>
   </PropertyGroup>

From b7e343facc64da9ac43fca4031401a3588d3426c Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 4 Jun 2021 15:32:40 +0200
Subject: [PATCH 45/48] First files splittings 1 type(class,enum) per file

---
 .../Containers/BubbleExceptionContainer.cs    |  13 +
 .../Containers/ClassOrEnumType.cs             |  12 +
 .../Containers/MethodsGroupEncaps.cs          |  14 +
 .../Containers/StronglyTypedVariable.cs       |  14 +
 .../Enums/BlockIndentation.cs                 |   8 +
 ...ionOnNoReturnKeywordFoundInScriptAction.cs |   9 +
 .../Enums/SimplifiedCollectionMode.cs         |   8 +
 .../Enums/SyntaxForBlockIdentifier.cs         |   9 +
 .../SyntaxForHeadStatementInBlocksKeywords.cs |  10 +
 .../EventArgs/ExpressionEvaluationEventArg.cs |  51 ++
 .../EventArgs/FunctionEvaluationEventArg.cs   | 116 +++
 .../FunctionPreEvaluationEventArg.cs          |  20 +
 .../IndexingPreEvaluationEventArg.cs          |  88 +++
 .../ParameterCastEvaluationEventArg.cs        |  73 ++
 .../EventArgs/VariableEvaluationEventArg.cs   |  83 +++
 .../VariablePreEvaluationEventArg.cs          |  19 +
 .../ExpressionEvaluatorSecurityException.cs   |  19 +
 ...ExpressionEvaluatorSyntaxErrorException.cs |  20 +
 .../ExpressionEvaluator.cs                    | 668 +-----------------
 .../Operators/ExpressionOperator.cs           |  64 ++
 .../OperatorsEvaluationsExtensions.cs         |  87 +++
 .../SubExpression.cs                          |  15 +
 22 files changed, 756 insertions(+), 664 deletions(-)
 create mode 100644 CodingSeb.ExpressionEvaluator/Containers/BubbleExceptionContainer.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Containers/ClassOrEnumType.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Containers/MethodsGroupEncaps.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Containers/StronglyTypedVariable.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Enums/BlockIndentation.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Enums/OptionOnNoReturnKeywordFoundInScriptAction.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Enums/SimplifiedCollectionMode.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Enums/SyntaxForBlockIdentifier.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Enums/SyntaxForHeadStatementInBlocksKeywords.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/EventArgs/ExpressionEvaluationEventArg.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/EventArgs/FunctionEvaluationEventArg.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/EventArgs/FunctionPreEvaluationEventArg.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/EventArgs/IndexingPreEvaluationEventArg.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/EventArgs/ParameterCastEvaluationEventArg.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/EventArgs/VariableEvaluationEventArg.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/EventArgs/VariablePreEvaluationEventArg.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Exceptions/ExpressionEvaluatorSecurityException.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Exceptions/ExpressionEvaluatorSyntaxErrorException.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Operators/ExpressionOperator.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/Operators/OperatorsEvaluationsExtensions.cs
 create mode 100644 CodingSeb.ExpressionEvaluator/SubExpression.cs

diff --git a/CodingSeb.ExpressionEvaluator/Containers/BubbleExceptionContainer.cs b/CodingSeb.ExpressionEvaluator/Containers/BubbleExceptionContainer.cs
new file mode 100644
index 0000000..925480a
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Containers/BubbleExceptionContainer.cs
@@ -0,0 +1,13 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator.Containers
+{
+    /// <summary>
+    /// This class is a container for exception that need to be bubble up before to be thrown.
+    /// Avoid to assign exception to variables.
+    /// </summary>
+    public partial class BubbleExceptionContainer
+    {
+        public Exception Exception { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Containers/ClassOrEnumType.cs b/CodingSeb.ExpressionEvaluator/Containers/ClassOrEnumType.cs
new file mode 100644
index 0000000..3b4526c
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Containers/ClassOrEnumType.cs
@@ -0,0 +1,12 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator.Containers
+{
+    /// <summary>
+    /// This class is a container for types to evaluate the as static access to it
+    /// </summary>
+    public partial class ClassOrEnumType
+    {
+        public Type Type { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Containers/MethodsGroupEncaps.cs b/CodingSeb.ExpressionEvaluator/Containers/MethodsGroupEncaps.cs
new file mode 100644
index 0000000..d9f13f4
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Containers/MethodsGroupEncaps.cs
@@ -0,0 +1,14 @@
+﻿using System.Reflection;
+
+namespace CodingSeb.ExpressionEvaluator.Containers
+{
+    /// <summary>
+    /// This class is a container used to store a groups of overrides method until the real call of the method to select which override of the method to use.
+    /// </summary>
+    public partial class MethodsGroupEncaps
+    {
+        public object ContainerObject { get; set; }
+
+        public MethodInfo[] MethodsGroup { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Containers/StronglyTypedVariable.cs b/CodingSeb.ExpressionEvaluator/Containers/StronglyTypedVariable.cs
new file mode 100644
index 0000000..7adcdc4
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Containers/StronglyTypedVariable.cs
@@ -0,0 +1,14 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator.Containers
+{
+    /// <summary>
+    /// This class is a container for typed variable declaration. To force the evaluator to only allow to store variable of this type.
+    /// </summary>
+    public partial class StronglyTypedVariable
+    {
+        public Type Type { get; set; }
+
+        public object Value { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Enums/BlockIndentation.cs b/CodingSeb.ExpressionEvaluator/Enums/BlockIndentation.cs
new file mode 100644
index 0000000..103b912
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Enums/BlockIndentation.cs
@@ -0,0 +1,8 @@
+﻿namespace CodingSeb.ExpressionEvaluator
+{
+    public enum BlockIndentation
+    {
+        Tabulation,
+        Spaces
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Enums/OptionOnNoReturnKeywordFoundInScriptAction.cs b/CodingSeb.ExpressionEvaluator/Enums/OptionOnNoReturnKeywordFoundInScriptAction.cs
new file mode 100644
index 0000000..9cf5bf4
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Enums/OptionOnNoReturnKeywordFoundInScriptAction.cs
@@ -0,0 +1,9 @@
+﻿namespace CodingSeb.ExpressionEvaluator
+{
+    public enum OptionOnNoReturnKeywordFoundInScriptAction
+    {
+        ReturnAutomaticallyLastEvaluatedExpression,
+        ReturnNull,
+        ThrowSyntaxException
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Enums/SimplifiedCollectionMode.cs b/CodingSeb.ExpressionEvaluator/Enums/SimplifiedCollectionMode.cs
new file mode 100644
index 0000000..2338165
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Enums/SimplifiedCollectionMode.cs
@@ -0,0 +1,8 @@
+﻿namespace CodingSeb.ExpressionEvaluator
+{
+    public enum SimplifiedCollectionMode
+    {
+        Array,
+        List
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Enums/SyntaxForBlockIdentifier.cs b/CodingSeb.ExpressionEvaluator/Enums/SyntaxForBlockIdentifier.cs
new file mode 100644
index 0000000..f785bcb
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Enums/SyntaxForBlockIdentifier.cs
@@ -0,0 +1,9 @@
+﻿namespace CodingSeb.ExpressionEvaluator
+{
+    public enum SyntaxForBlockIdentifier
+    {
+        OptionalBracketsForStartAndEndWhenSingleStatement,
+        MandatoryBracketsForStartAndEnd,
+        Indentation
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Enums/SyntaxForHeadStatementInBlocksKeywords.cs b/CodingSeb.ExpressionEvaluator/Enums/SyntaxForHeadStatementInBlocksKeywords.cs
new file mode 100644
index 0000000..edf5944
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Enums/SyntaxForHeadStatementInBlocksKeywords.cs
@@ -0,0 +1,10 @@
+﻿namespace CodingSeb.ExpressionEvaluator
+{
+    public enum SyntaxForHeadStatementInBlocksKeywords
+    {
+        HeadBrackets,
+        SeparatorBetweenHeadAndBlock,
+        Both,
+        Any
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/EventArgs/ExpressionEvaluationEventArg.cs b/CodingSeb.ExpressionEvaluator/EventArgs/ExpressionEvaluationEventArg.cs
new file mode 100644
index 0000000..8d20d02
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/EventArgs/ExpressionEvaluationEventArg.cs
@@ -0,0 +1,51 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator
+{
+    /// <summary>
+    /// Infos about the expression that is currently evaluate
+    /// </summary>
+    public partial class ExpressionEvaluationEventArg : EventArgs
+    {
+        private object value;
+
+        public ExpressionEvaluationEventArg(string expression, ExpressionEvaluator evaluator)
+        {
+            Expression = expression;
+            Evaluator = evaluator;
+        }
+
+        public ExpressionEvaluationEventArg(string expression, ExpressionEvaluator evaluator, object value)
+        {
+            Expression = expression;
+            Evaluator = evaluator;
+            this.value = value;
+        }
+
+        public ExpressionEvaluator Evaluator { get; }
+
+        /// <summary>
+        /// The Expression that will be evaluated.
+        /// Can be modified.
+        /// </summary>
+        public string Expression { get; set; }
+
+        /// <summary>
+        /// To set the return of the evaluation
+        /// </summary>
+        public object Value
+        {
+            get { return value; }
+            set
+            {
+                this.value = value;
+                HasValue = true;
+            }
+        }
+
+        /// <summary>
+        /// if <c>true</c> the expression evaluation has been done, if <c>false</c> it means that the evaluation must continue.
+        /// </summary>
+        public bool HasValue { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/EventArgs/FunctionEvaluationEventArg.cs b/CodingSeb.ExpressionEvaluator/EventArgs/FunctionEvaluationEventArg.cs
new file mode 100644
index 0000000..c095c91
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/EventArgs/FunctionEvaluationEventArg.cs
@@ -0,0 +1,116 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace CodingSeb.ExpressionEvaluator
+{
+    /// <summary>
+    /// Infos about the function or method that is currently evaluate
+    /// </summary>
+    public partial class FunctionEvaluationEventArg : EventArgs
+    {
+        private readonly Func<string, Type[]> evaluateGenericTypes;
+        private readonly string genericTypes;
+
+        public FunctionEvaluationEventArg(string name, List<string> args = null, ExpressionEvaluator evaluator = null, object onInstance = null, string genericTypes = null, Func<string, Type[]> evaluateGenericTypes = null)
+        {
+            Name = name;
+            Args = args ?? new List<string>();
+            This = onInstance;
+            Evaluator = evaluator;
+            this.genericTypes = genericTypes;
+            this.evaluateGenericTypes = evaluateGenericTypes;
+        }
+
+        /// <summary>
+        /// The not evaluated args of the function
+        /// </summary>
+        public List<string> Args { get; } = new List<string>();
+
+        /// <summary>
+        /// Get the values of the function's args.
+        /// </summary>
+        /// <returns></returns>
+        public object[] EvaluateArgs()
+        {
+            return Args.ConvertAll(arg => Evaluator.Evaluate(arg)).ToArray();
+        }
+
+        /// <summary>
+        /// Get the value of the function's arg at the specified index
+        /// </summary>
+        /// <param name="index">The index of the function's arg to evaluate</param>
+        /// <returns>The evaluated arg</returns>
+        public object EvaluateArg(int index)
+        {
+            return Evaluator.Evaluate(Args[index]);
+        }
+
+        /// <summary>
+        /// Get the value of the function's arg at the specified index
+        /// </summary>
+        /// <typeparam name="T">The type of the result to get. (Do a cast)</typeparam>
+        /// <param name="index">The index of the function's arg to evaluate</param>
+        /// <returns>The evaluated arg casted in the specified type</returns>
+        public T EvaluateArg<T>(int index)
+        {
+            return Evaluator.Evaluate<T>(Args[index]);
+        }
+
+        /// <summary>
+        /// The name of the variable to Evaluate
+        /// </summary>
+        public string Name { get; }
+
+        private object returnValue;
+
+        /// <summary>
+        /// To set the return value of the function
+        /// </summary>
+        public object Value
+        {
+            get { return returnValue; }
+            set
+            {
+                returnValue = value;
+                FunctionReturnedValue = true;
+            }
+        }
+
+        /// <summary>
+        /// If <c>true</c> the function evaluation has been done, if <c>false</c> it means that the function does not exist.
+        /// </summary>
+        public bool FunctionReturnedValue { get; set; }
+
+        /// <summary>
+        /// In the case of on the fly instance method definition the instance of the object on which this method (function) is called.
+        /// Otherwise is set to null.
+        /// </summary>
+        public object This { get; }
+
+        /// <summary>
+        /// A reference on the current expression evaluator.
+        /// </summary>
+        public ExpressionEvaluator Evaluator { get; }
+
+        /// <summary>
+        /// Is <c>true</c> if some generic types are specified with &lt;&gt;.
+        /// <c>false</c> otherwise
+        /// </summary>
+        public bool HasGenericTypes
+        {
+            get
+            {
+                return !string.IsNullOrEmpty(genericTypes);
+            }
+        }
+
+        /// <summary>
+        /// In the case where generic types are specified with &lt;&gt;
+        /// Evaluate all types and return an array of types
+        /// </summary>
+        public Type[] EvaluateGenericTypes()
+        {
+            return evaluateGenericTypes?.Invoke(genericTypes) ?? new Type[0];
+        }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/EventArgs/FunctionPreEvaluationEventArg.cs b/CodingSeb.ExpressionEvaluator/EventArgs/FunctionPreEvaluationEventArg.cs
new file mode 100644
index 0000000..6231125
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/EventArgs/FunctionPreEvaluationEventArg.cs
@@ -0,0 +1,20 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace CodingSeb.ExpressionEvaluator
+{
+    /// <summary>
+    /// Infos about the function or method that is currently evaluate
+    /// </summary>
+    public partial class FunctionPreEvaluationEventArg : FunctionEvaluationEventArg
+    {
+        public FunctionPreEvaluationEventArg(string name, List<string> args = null, ExpressionEvaluator evaluator = null, object onInstance = null, string genericTypes = null, Func<string, Type[]> evaluateGenericTypes = null)
+            : base(name, args, evaluator, onInstance, genericTypes, evaluateGenericTypes)
+        { }
+
+        /// <summary>
+        /// If set to true cancel the evaluation of the current function or method and throw an exception that the function does not exists
+        /// </summary>
+        public bool CancelEvaluation { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/EventArgs/IndexingPreEvaluationEventArg.cs b/CodingSeb.ExpressionEvaluator/EventArgs/IndexingPreEvaluationEventArg.cs
new file mode 100644
index 0000000..ccc057e
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/EventArgs/IndexingPreEvaluationEventArg.cs
@@ -0,0 +1,88 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace CodingSeb.ExpressionEvaluator
+{
+    /// <summary>
+    /// Infos about the indexing that is currently evaluate
+    /// </summary>
+    public partial class IndexingPreEvaluationEventArg : EventArgs
+    {
+        public IndexingPreEvaluationEventArg(List<string> args, ExpressionEvaluator evaluator, object onInstance)
+        {
+            Args = args;
+            This = onInstance;
+            Evaluator = evaluator;
+        }
+
+        /// <summary>
+        /// The not evaluated args of the indexing
+        /// </summary>
+        public List<string> Args { get; } = new List<string>();
+
+        /// <summary>
+        /// The instance of the object on which the indexing is called.
+        /// </summary>
+        public object This { get; }
+
+        private object returnValue;
+
+        /// <summary>
+        /// To set the result value of the indexing
+        /// </summary>
+        public object Value
+        {
+            get { return returnValue; }
+            set
+            {
+                returnValue = value;
+                HasValue = true;
+            }
+        }
+
+        /// <summary>
+        /// if <c>true</c> the indexing evaluation has been done, if <c>false</c> it means that the indexing does not exist.
+        /// </summary>
+        public bool HasValue { get; set; }
+
+        /// <summary>
+        /// A reference on the current expression evaluator.
+        /// </summary>
+        public ExpressionEvaluator Evaluator { get; }
+
+        /// <summary>
+        /// Get the values of the indexing's args.
+        /// </summary>
+        /// <returns></returns>
+        public object[] EvaluateArgs()
+        {
+            return Args.ConvertAll(arg => Evaluator.Evaluate(arg)).ToArray();
+        }
+
+        /// <summary>
+        /// Get the value of the indexing's arg at the specified index
+        /// </summary>
+        /// <param name="index">The index of the indexing's arg to evaluate</param>
+        /// <returns>The evaluated arg</returns>
+        public object EvaluateArg(int index)
+        {
+            return Evaluator.Evaluate(Args[index]);
+        }
+
+        /// <summary>
+        /// Get the value of the indexing's arg at the specified index
+        /// </summary>
+        /// <typeparam name="T">The type of the result to get. (Do a cast)</typeparam>
+        /// <param name="index">The index of the indexing's arg to evaluate</param>
+        /// <returns>The evaluated arg casted in the specified type</returns>
+        public T EvaluateArg<T>(int index)
+        {
+            return Evaluator.Evaluate<T>(Args[index]);
+        }
+
+        /// <summary>
+        /// If set to true cancel the evaluation of the current function or method and throw an exception that the function does not exists
+        /// </summary>
+        public bool CancelEvaluation { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/EventArgs/ParameterCastEvaluationEventArg.cs b/CodingSeb.ExpressionEvaluator/EventArgs/ParameterCastEvaluationEventArg.cs
new file mode 100644
index 0000000..971cd18
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/EventArgs/ParameterCastEvaluationEventArg.cs
@@ -0,0 +1,73 @@
+﻿using System;
+using System.Reflection;
+
+namespace CodingSeb.ExpressionEvaluator
+{
+    /// <summary>
+    /// Class ParameterCastEvaluationEventArg.
+    /// Implements the <see cref="System.EventArgs" /></summary>
+    /// <seealso cref="System.EventArgs" />
+    public partial class ParameterCastEvaluationEventArg : EventArgs
+    {
+        /// <summary>
+        /// The information of the method that it try to call
+        /// </summary>
+        public MethodInfo MethodInfo { get; }
+
+        /// <summary>
+        /// In the case of on the fly instance method definition the instance of the object on which this method (function) is called.
+        /// Otherwise is set to null.
+        /// </summary>
+        public object This { get; }
+
+        /// <summary>
+        /// A reference on the current expression evaluator.
+        /// </summary>
+        public ExpressionEvaluator Evaluator { get; }
+
+        /// <summary>
+        /// The required type of the parameter
+        /// </summary>
+        public Type ParameterType { get; }
+
+        /// <summary>
+        /// The original argument
+        /// </summary>
+        public object OriginalArg { get; }
+
+        /// <summary>
+        /// Position of the argument (index from 0)
+        /// </summary>
+        public int ArgPosition { get; }
+
+        public ParameterCastEvaluationEventArg(MethodInfo methodInfo, Type parameterType, object originalArg, int argPosition, ExpressionEvaluator evaluator = null, object onInstance = null)
+        {
+            MethodInfo = methodInfo;
+            ParameterType = parameterType;
+            OriginalArg = originalArg;
+            Evaluator = evaluator;
+            This = onInstance;
+            ArgPosition = argPosition;
+        }
+
+        private object modifiedArgument;
+
+        /// <summary>
+        /// To set the modified argument
+        /// </summary>
+        public object Argument
+        {
+            get { return modifiedArgument; }
+            set
+            {
+                modifiedArgument = value;
+                FunctionModifiedArgument = true;
+            }
+        }
+
+        /// <summary>
+        /// if <c>true</c> the argument has been modified, if <c>false</c> it means that the argument can't be of the given type.
+        /// </summary>
+        public bool FunctionModifiedArgument { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/EventArgs/VariableEvaluationEventArg.cs b/CodingSeb.ExpressionEvaluator/EventArgs/VariableEvaluationEventArg.cs
new file mode 100644
index 0000000..ac03276
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/EventArgs/VariableEvaluationEventArg.cs
@@ -0,0 +1,83 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator
+{
+    /// <summary>
+    /// Infos about the variable, attribut or property that is currently evaluate
+    /// </summary>
+    public partial class VariableEvaluationEventArg : EventArgs
+    {
+        private readonly Func<string, Type[]> evaluateGenericTypes;
+        private readonly string genericTypes;
+
+        /// <summary>
+        /// Constructor of the VariableEvaluationEventArg
+        /// </summary>
+        /// <param name="name">The name of the variable to Evaluate</param>
+        public VariableEvaluationEventArg(string name, ExpressionEvaluator evaluator = null, object onInstance = null, string genericTypes = null, Func<string, Type[]> evaluateGenericTypes = null)
+        {
+            Name = name;
+            This = onInstance;
+            Evaluator = evaluator;
+            this.genericTypes = genericTypes;
+            this.evaluateGenericTypes = evaluateGenericTypes;
+        }
+
+        /// <summary>
+        /// The name of the variable to Evaluate
+        /// </summary>
+        public string Name { get; }
+
+        private object varValue;
+
+        /// <summary>
+        /// To set a value to this variable
+        /// </summary>
+        public object Value
+        {
+            get { return varValue; }
+            set
+            {
+                varValue = value;
+                HasValue = true;
+            }
+        }
+
+        /// <summary>
+        /// If <c>true</c> the variable is affected, if <c>false</c> it means that the variable does not exist.
+        /// </summary>
+        public bool HasValue { get; set; }
+
+        /// <summary>
+        /// In the case of on the fly instance property definition the instance of the object on which this Property is called.
+        /// Otherwise is set to null.
+        /// </summary>
+        public object This { get; }
+
+        /// <summary>
+        /// A reference on the current expression evaluator.
+        /// </summary>
+        public ExpressionEvaluator Evaluator { get; }
+
+        /// <summary>
+        /// Is <c>true</c> if some generic types are specified with &lt;&gt;.
+        /// <c>false</c> otherwise
+        /// </summary>
+        public bool HasGenericTypes
+        {
+            get
+            {
+                return !string.IsNullOrEmpty(genericTypes);
+            }
+        }
+
+        /// <summary>
+        /// In the case where generic types are specified with &lt;&gt;
+        /// Evaluate all types and return an array of types
+        /// </summary>
+        public Type[] EvaluateGenericTypes()
+        {
+            return evaluateGenericTypes?.Invoke(genericTypes) ?? new Type[0];
+        }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/EventArgs/VariablePreEvaluationEventArg.cs b/CodingSeb.ExpressionEvaluator/EventArgs/VariablePreEvaluationEventArg.cs
new file mode 100644
index 0000000..01ef377
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/EventArgs/VariablePreEvaluationEventArg.cs
@@ -0,0 +1,19 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator
+{
+    /// <summary>
+    /// Infos about the variable, attribut or property that is currently evaluate
+    /// </summary>
+    public partial class VariablePreEvaluationEventArg : VariableEvaluationEventArg
+    {
+        public VariablePreEvaluationEventArg(string name, ExpressionEvaluator evaluator = null, object onInstance = null, string genericTypes = null, Func<string, Type[]> evaluateGenericTypes = null)
+            : base(name, evaluator, onInstance, genericTypes, evaluateGenericTypes)
+        { }
+
+        /// <summary>
+        /// If set to true cancel the evaluation of the current variable, field or property and throw an exception it does not exists
+        /// </summary>
+        public bool CancelEvaluation { get; set; }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Exceptions/ExpressionEvaluatorSecurityException.cs b/CodingSeb.ExpressionEvaluator/Exceptions/ExpressionEvaluatorSecurityException.cs
new file mode 100644
index 0000000..e06c7ac
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Exceptions/ExpressionEvaluatorSecurityException.cs
@@ -0,0 +1,19 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator.Exceptions
+{
+    /// <summary>
+    /// An Exception thrown when script or exception try to access type or object that are blocked for security reasons
+    /// </summary>
+    public partial class ExpressionEvaluatorSecurityException : Exception
+    {
+        public ExpressionEvaluatorSecurityException()
+        { }
+
+        public ExpressionEvaluatorSecurityException(string message) : base(message)
+        { }
+
+        public ExpressionEvaluatorSecurityException(string message, Exception innerException) : base(message, innerException)
+        { }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Exceptions/ExpressionEvaluatorSyntaxErrorException.cs b/CodingSeb.ExpressionEvaluator/Exceptions/ExpressionEvaluatorSyntaxErrorException.cs
new file mode 100644
index 0000000..b3be4c9
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Exceptions/ExpressionEvaluatorSyntaxErrorException.cs
@@ -0,0 +1,20 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator.Exceptions
+{
+    /// <summary>
+    /// An exception thrown when a syntax error is found in an expression or a script
+    /// </summary>
+    public partial class ExpressionEvaluatorSyntaxErrorException : Exception
+    {
+        public ExpressionEvaluatorSyntaxErrorException()
+        { }
+
+        public ExpressionEvaluatorSyntaxErrorException(string message) : base(message)
+        { }
+
+        public ExpressionEvaluatorSyntaxErrorException(string message, Exception innerException) : base(message, innerException)
+        { }
+    }
+
+}
diff --git a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
index dfe3b21..62e210b 100644
--- a/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
+++ b/CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs
@@ -22,6 +22,10 @@
 
 namespace CodingSeb.ExpressionEvaluator
 {
+    using Operators;
+    using Exceptions;
+    using Containers;
+
     /// <summary>
     /// This class allow to evaluate a string math or pseudo C# expression
     /// </summary>
@@ -4879,668 +4883,4 @@ public TResult Func16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T1
 
         #endregion
     }
-
-    #region linked enums
-
-    public enum OptionOnNoReturnKeywordFoundInScriptAction
-    {
-        ReturnAutomaticallyLastEvaluatedExpression,
-        ReturnNull,
-        ThrowSyntaxException
-    }
-
-    public enum SyntaxForHeadStatementInBlocksKeywords
-    {
-        HeadBrackets,
-        SeparatorBetweenHeadAndBlock,
-        Both,
-        Any
-    }
-
-    public enum SyntaxForBlockIdentifier
-    {
-        OptionalBracketsForStartAndEndWhenSingleStatement,
-        MandatoryBracketsForStartAndEnd,
-        Indentation
-    }
-
-    public enum BlockIndentation
-    {
-        Tabulation,
-        Spaces
-    }
-
-    public enum SimplifiedCollectionMode
-    {
-        Array,
-        List
-    }
-
-    #endregion
-
-    #region ExpressionEvaluator linked public classes (specific Exceptions, EventArgs and Operators)
-
-    #region Operators Management
-
-    public partial class ExpressionOperator : IEquatable<ExpressionOperator>
-    {
-        protected static uint indexer;
-
-        protected ExpressionOperator()
-        {
-            indexer++;
-            OperatorValue = indexer;
-        }
-
-        protected uint OperatorValue { get; }
-
-        public static readonly ExpressionOperator Plus = new ExpressionOperator();
-        public static readonly ExpressionOperator Minus = new ExpressionOperator();
-        public static readonly ExpressionOperator UnaryPlus = new ExpressionOperator();
-        public static readonly ExpressionOperator UnaryMinus = new ExpressionOperator();
-        public static readonly ExpressionOperator Multiply = new ExpressionOperator();
-        public static readonly ExpressionOperator Divide = new ExpressionOperator();
-        public static readonly ExpressionOperator Modulo = new ExpressionOperator();
-        public static readonly ExpressionOperator Lower = new ExpressionOperator();
-        public static readonly ExpressionOperator Greater = new ExpressionOperator();
-        public static readonly ExpressionOperator Equal = new ExpressionOperator();
-        public static readonly ExpressionOperator LowerOrEqual = new ExpressionOperator();
-        public static readonly ExpressionOperator GreaterOrEqual = new ExpressionOperator();
-        public static readonly ExpressionOperator Is = new ExpressionOperator();
-        public static readonly ExpressionOperator NotEqual = new ExpressionOperator();
-        public static readonly ExpressionOperator LogicalNegation = new ExpressionOperator();
-        public static readonly ExpressionOperator BitwiseComplement = new ExpressionOperator();
-        public static readonly ExpressionOperator ConditionalAnd = new ExpressionOperator();
-        public static readonly ExpressionOperator ConditionalOr = new ExpressionOperator();
-        public static readonly ExpressionOperator LogicalAnd = new ExpressionOperator();
-        public static readonly ExpressionOperator LogicalOr = new ExpressionOperator();
-        public static readonly ExpressionOperator LogicalXor = new ExpressionOperator();
-        public static readonly ExpressionOperator ShiftBitsLeft = new ExpressionOperator();
-        public static readonly ExpressionOperator ShiftBitsRight = new ExpressionOperator();
-        public static readonly ExpressionOperator NullCoalescing = new ExpressionOperator();
-        public static readonly ExpressionOperator Cast = new ExpressionOperator();
-
-        public override bool Equals(object obj)
-        {
-            if (obj is ExpressionOperator otherOperator)
-                return Equals(otherOperator);
-            else
-                return OperatorValue.Equals(obj);
-        }
-
-        public override int GetHashCode()
-        {
-            return OperatorValue.GetHashCode();
-        }
-
-        public bool Equals(ExpressionOperator otherOperator)
-        {
-            return otherOperator != null && OperatorValue == otherOperator.OperatorValue;
-        }
-    }
-
-    public partial class ScriptBlocksKeyword
-    {
-        public ScriptBlocksKeyword(string name)
-        {
-            Name = name;
-        }
-
-        public string Name { get; set; }
-    }
-
-    public static partial class OperatorsEvaluationsExtensions
-    {
-        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> Copy(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations)
-        {
-            return operatorsEvaluations
-                .Select(dic => (IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>)new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>>(dic))
-                .ToList();
-        }
-
-        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtLevelOf(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, ExpressionOperator levelOfThisOperator)
-        {
-            operatorsEvaluations
-                .First(dict => dict.ContainsKey(levelOfThisOperator))
-                .Add(operatorToAdd, evaluation);
-
-            return operatorsEvaluations;
-        }
-
-        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtLevel(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, int level)
-        {
-            operatorsEvaluations[level]
-                .Add(operatorToAdd, evaluation);
-
-            return operatorsEvaluations;
-        }
-
-        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtNewLevelAfter(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, ExpressionOperator levelOfThisOperator)
-        {
-            int level = operatorsEvaluations
-                .IndexOf(operatorsEvaluations.First(dict => dict.ContainsKey(levelOfThisOperator)));
-
-            operatorsEvaluations
-                .Insert(level + 1, new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>> { { operatorToAdd, evaluation } });
-
-            return operatorsEvaluations;
-        }
-
-        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtNewLevelBefore(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, ExpressionOperator levelOfThisOperator)
-        {
-            int level = operatorsEvaluations
-                .IndexOf(operatorsEvaluations.First(dict => dict.ContainsKey(levelOfThisOperator)));
-
-            operatorsEvaluations
-                .Insert(level, new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>> { { operatorToAdd, evaluation } });
-
-            return operatorsEvaluations;
-        }
-
-        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtNewLevel(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, int level)
-        {
-            operatorsEvaluations
-                .Insert(level, new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>> { { operatorToAdd, evaluation } });
-
-            return operatorsEvaluations;
-        }
-
-        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> RemoveOperatorEvaluation(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToRemove)
-        {
-            operatorsEvaluations.First(dict => dict.ContainsKey(operatorToRemove)).Remove(operatorToRemove);
-
-            return operatorsEvaluations;
-        }
-
-        public static IList<ExpressionOperator> FluidAdd(this IList<ExpressionOperator> listOfOperator, ExpressionOperator operatorToAdd)
-        {
-            listOfOperator.Add(operatorToAdd);
-
-            return listOfOperator;
-        }
-
-        public static IList<ExpressionOperator> FluidRemove(this IList<ExpressionOperator> listOfOperator, ExpressionOperator operatorToRemove)
-        {
-            listOfOperator.Remove(operatorToRemove);
-
-            return listOfOperator;
-        }
-    }
-
-    #endregion
-
-    public partial class ClassOrEnumType
-    {
-        public Type Type { get; set; }
-    }
-
-    public partial class StronglyTypedVariable
-    {
-        public Type Type { get; set; }
-
-        public object Value { get; set; }
-    }
-
-    public partial class SubExpression
-    {
-        public string Expression { get; set; }
-
-        public SubExpression(string expression)
-        {
-            Expression = expression;
-        }
-    }
-
-    public partial class MethodsGroupEncaps
-    {
-        public object ContainerObject { get; set; }
-
-        public MethodInfo[] MethodsGroup { get; set; }
-    }
-
-    public partial class BubbleExceptionContainer
-    {
-        public Exception Exception { get; set; }
-    }
-
-    public partial class ExpressionEvaluatorSyntaxErrorException : Exception
-    {
-        public ExpressionEvaluatorSyntaxErrorException()
-        { }
-
-        public ExpressionEvaluatorSyntaxErrorException(string message) : base(message)
-        { }
-
-        public ExpressionEvaluatorSyntaxErrorException(string message, Exception innerException) : base(message, innerException)
-        { }
-    }
-
-    public partial class ExpressionEvaluatorSecurityException : Exception
-    {
-        public ExpressionEvaluatorSecurityException()
-        { }
-
-        public ExpressionEvaluatorSecurityException(string message) : base(message)
-        { }
-
-        public ExpressionEvaluatorSecurityException(string message, Exception innerException) : base(message, innerException)
-        { }
-    }
-
-    /// <summary>
-    /// Infos about the variable, attribut or property that is currently evaluate
-    /// </summary>
-    public partial class VariableEvaluationEventArg : EventArgs
-    {
-        private readonly Func<string, Type[]> evaluateGenericTypes;
-        private readonly string genericTypes;
-
-        /// <summary>
-        /// Constructor of the VariableEvaluationEventArg
-        /// </summary>
-        /// <param name="name">The name of the variable to Evaluate</param>
-        public VariableEvaluationEventArg(string name, ExpressionEvaluator evaluator = null, object onInstance = null, string genericTypes = null, Func<string, Type[]> evaluateGenericTypes = null)
-        {
-            Name = name;
-            This = onInstance;
-            Evaluator = evaluator;
-            this.genericTypes = genericTypes;
-            this.evaluateGenericTypes = evaluateGenericTypes;
-        }
-
-        /// <summary>
-        /// The name of the variable to Evaluate
-        /// </summary>
-        public string Name { get; }
-
-        private object varValue;
-
-        /// <summary>
-        /// To set a value to this variable
-        /// </summary>
-        public object Value
-        {
-            get { return varValue; }
-            set
-            {
-                varValue = value;
-                HasValue = true;
-            }
-        }
-
-        /// <summary>
-        /// If <c>true</c> the variable is affected, if <c>false</c> it means that the variable does not exist.
-        /// </summary>
-        public bool HasValue { get; set; }
-
-        /// <summary>
-        /// In the case of on the fly instance property definition the instance of the object on which this Property is called.
-        /// Otherwise is set to null.
-        /// </summary>
-        public object This { get; }
-
-        /// <summary>
-        /// A reference on the current expression evaluator.
-        /// </summary>
-        public ExpressionEvaluator Evaluator { get; }
-
-        /// <summary>
-        /// Is <c>true</c> if some generic types are specified with &lt;&gt;.
-        /// <c>false</c> otherwise
-        /// </summary>
-        public bool HasGenericTypes
-        {
-            get
-            {
-                return !string.IsNullOrEmpty(genericTypes);
-            }
-        }
-
-        /// <summary>
-        /// In the case where generic types are specified with &lt;&gt;
-        /// Evaluate all types and return an array of types
-        /// </summary>
-        public Type[] EvaluateGenericTypes()
-        {
-            return evaluateGenericTypes?.Invoke(genericTypes) ?? new Type[0];
-        }
-    }
-
-    public partial class ExpressionEvaluationEventArg : EventArgs
-    {
-        private object value;
-
-        public ExpressionEvaluationEventArg(string expression, ExpressionEvaluator evaluator)
-        {
-            Expression = expression;
-            Evaluator = evaluator;
-        }
-
-        public ExpressionEvaluationEventArg(string expression, ExpressionEvaluator evaluator, object value)
-        {
-            Expression = expression;
-            Evaluator = evaluator;
-            this.value = value;
-        }
-
-        public ExpressionEvaluator Evaluator { get; }
-
-        /// <summary>
-        /// The Expression that wil be evaluated.
-        /// Can be modified.
-        /// </summary>
-        public string Expression { get; set; }
-
-        /// <summary>
-        /// To set the return of the evaluation
-        /// </summary>
-        public object Value
-        {
-            get { return value; }
-            set
-            {
-                this.value = value;
-                HasValue = true;
-            }
-        }
-
-        /// <summary>
-        /// if <c>true</c> the expression evaluation has been done, if <c>false</c> it means that the evaluation must continue.
-        /// </summary>
-        public bool HasValue { get; set; }
-    }
-
-    /// <summary>
-    /// Infos about the variable, attribut or property that is currently evaluate
-    /// </summary>
-    public partial class VariablePreEvaluationEventArg : VariableEvaluationEventArg
-    {
-        public VariablePreEvaluationEventArg(string name, ExpressionEvaluator evaluator = null, object onInstance = null, string genericTypes = null, Func<string, Type[]> evaluateGenericTypes = null)
-            : base(name, evaluator, onInstance, genericTypes, evaluateGenericTypes)
-        { }
-
-        /// <summary>
-        /// If set to true cancel the evaluation of the current variable, field or property and throw an exception it does not exists
-        /// </summary>
-        public bool CancelEvaluation { get; set; }
-    }
-
-    /// <summary>
-    /// Infos about the function or method that is currently evaluate
-    /// </summary>
-    public partial class FunctionEvaluationEventArg : EventArgs
-    {
-        private readonly Func<string, Type[]> evaluateGenericTypes;
-        private readonly string genericTypes;
-
-        public FunctionEvaluationEventArg(string name, List<string> args = null, ExpressionEvaluator evaluator = null, object onInstance = null, string genericTypes = null, Func<string, Type[]> evaluateGenericTypes = null)
-        {
-            Name = name;
-            Args = args ?? new List<string>();
-            This = onInstance;
-            Evaluator = evaluator;
-            this.genericTypes = genericTypes;
-            this.evaluateGenericTypes = evaluateGenericTypes;
-        }
-
-        /// <summary>
-        /// The not evaluated args of the function
-        /// </summary>
-        public List<string> Args { get; } = new List<string>();
-
-        /// <summary>
-        /// Get the values of the function's args.
-        /// </summary>
-        /// <returns></returns>
-        public object[] EvaluateArgs()
-        {
-            return Args.ConvertAll(arg => Evaluator.Evaluate(arg)).ToArray();
-        }
-
-        /// <summary>
-        /// Get the value of the function's arg at the specified index
-        /// </summary>
-        /// <param name="index">The index of the function's arg to evaluate</param>
-        /// <returns>The evaluated arg</returns>
-        public object EvaluateArg(int index)
-        {
-            return Evaluator.Evaluate(Args[index]);
-        }
-
-        /// <summary>
-        /// Get the value of the function's arg at the specified index
-        /// </summary>
-        /// <typeparam name="T">The type of the result to get. (Do a cast)</typeparam>
-        /// <param name="index">The index of the function's arg to evaluate</param>
-        /// <returns>The evaluated arg casted in the specified type</returns>
-        public T EvaluateArg<T>(int index)
-        {
-            return Evaluator.Evaluate<T>(Args[index]);
-        }
-
-        /// <summary>
-        /// The name of the variable to Evaluate
-        /// </summary>
-        public string Name { get; }
-
-        private object returnValue;
-
-        /// <summary>
-        /// To set the return value of the function
-        /// </summary>
-        public object Value
-        {
-            get { return returnValue; }
-            set
-            {
-                returnValue = value;
-                FunctionReturnedValue = true;
-            }
-        }
-
-        /// <summary>
-        /// If <c>true</c> the function evaluation has been done, if <c>false</c> it means that the function does not exist.
-        /// </summary>
-        public bool FunctionReturnedValue { get; set; }
-
-        /// <summary>
-        /// In the case of on the fly instance method definition the instance of the object on which this method (function) is called.
-        /// Otherwise is set to null.
-        /// </summary>
-        public object This { get; }
-
-        /// <summary>
-        /// A reference on the current expression evaluator.
-        /// </summary>
-        public ExpressionEvaluator Evaluator { get; }
-
-        /// <summary>
-        /// Is <c>true</c> if some generic types are specified with &lt;&gt;.
-        /// <c>false</c> otherwise
-        /// </summary>
-        public bool HasGenericTypes
-        {
-            get
-            {
-                return !string.IsNullOrEmpty(genericTypes);
-            }
-        }
-
-        /// <summary>
-        /// In the case where generic types are specified with &lt;&gt;
-        /// Evaluate all types and return an array of types
-        /// </summary>
-        public Type[] EvaluateGenericTypes()
-        {
-            return evaluateGenericTypes?.Invoke(genericTypes) ?? new Type[0];
-        }
-    }
-
-    /// <summary>
-    /// Infos about the function or method that is currently evaluate
-    /// </summary>
-    public partial class FunctionPreEvaluationEventArg : FunctionEvaluationEventArg
-    {
-        public FunctionPreEvaluationEventArg(string name, List<string> args = null, ExpressionEvaluator evaluator = null, object onInstance = null, string genericTypes = null, Func<string, Type[]> evaluateGenericTypes = null)
-            : base(name, args, evaluator, onInstance, genericTypes, evaluateGenericTypes)
-        { }
-
-        /// <summary>
-        /// If set to true cancel the evaluation of the current function or method and throw an exception that the function does not exists
-        /// </summary>
-        public bool CancelEvaluation { get; set; }
-    }
-
-    /// <summary>
-    /// Infos about the indexing that is currently evaluate
-    /// </summary>
-    public partial class IndexingPreEvaluationEventArg : EventArgs
-    {
-        public IndexingPreEvaluationEventArg(List<string> args, ExpressionEvaluator evaluator, object onInstance)
-        {
-            Args = args;
-            This = onInstance;
-            Evaluator = evaluator;
-        }
-
-        /// <summary>
-        /// The not evaluated args of the indexing
-        /// </summary>
-        public List<string> Args { get; } = new List<string>();
-
-        /// <summary>
-        /// The instance of the object on which the indexing is called.
-        /// </summary>
-        public object This { get; }
-
-        private object returnValue;
-
-        /// <summary>
-        /// To set the result value of the indexing
-        /// </summary>
-        public object Value
-        {
-            get { return returnValue; }
-            set
-            {
-                returnValue = value;
-                HasValue = true;
-            }
-        }
-
-        /// <summary>
-        /// if <c>true</c> the indexing evaluation has been done, if <c>false</c> it means that the indexing does not exist.
-        /// </summary>
-        public bool HasValue { get; set; }
-
-        /// <summary>
-        /// A reference on the current expression evaluator.
-        /// </summary>
-        public ExpressionEvaluator Evaluator { get; }
-
-        /// <summary>
-        /// Get the values of the indexing's args.
-        /// </summary>
-        /// <returns></returns>
-        public object[] EvaluateArgs()
-        {
-            return Args.ConvertAll(arg => Evaluator.Evaluate(arg)).ToArray();
-        }
-
-        /// <summary>
-        /// Get the value of the indexing's arg at the specified index
-        /// </summary>
-        /// <param name="index">The index of the indexing's arg to evaluate</param>
-        /// <returns>The evaluated arg</returns>
-        public object EvaluateArg(int index)
-        {
-            return Evaluator.Evaluate(Args[index]);
-        }
-
-        /// <summary>
-        /// Get the value of the indexing's arg at the specified index
-        /// </summary>
-        /// <typeparam name="T">The type of the result to get. (Do a cast)</typeparam>
-        /// <param name="index">The index of the indexing's arg to evaluate</param>
-        /// <returns>The evaluated arg casted in the specified type</returns>
-        public T EvaluateArg<T>(int index)
-        {
-            return Evaluator.Evaluate<T>(Args[index]);
-        }
-
-        /// <summary>
-        /// If set to true cancel the evaluation of the current function or method and throw an exception that the function does not exists
-        /// </summary>
-        public bool CancelEvaluation { get; set; }
-    }
-
-    /// <summary>
-    /// Class ParameterCastEvaluationEventArg.
-    /// Implements the <see cref="System.EventArgs" /></summary>
-    /// <seealso cref="System.EventArgs" />
-    public partial class ParameterCastEvaluationEventArg : EventArgs
-    {
-        /// <summary>
-        /// The information of the method that it try to call
-        /// </summary>
-        public MethodInfo MethodInfo { get; }
-
-        /// <summary>
-        /// In the case of on the fly instance method definition the instance of the object on which this method (function) is called.
-        /// Otherwise is set to null.
-        /// </summary>
-        public object This { get; }
-
-        /// <summary>
-        /// A reference on the current expression evaluator.
-        /// </summary>
-        public ExpressionEvaluator Evaluator { get; }
-
-        /// <summary>
-        /// The required type of the parameter
-        /// </summary>
-        public Type ParameterType { get; }
-
-        /// <summary>
-        /// The original argument
-        /// </summary>
-        public object OriginalArg { get; }
-
-        /// <summary>
-        /// Position of the argument (index from 0)
-        /// </summary>
-        public int ArgPosition { get; }
-
-        public ParameterCastEvaluationEventArg(MethodInfo methodInfo, Type parameterType, object originalArg, int argPosition, ExpressionEvaluator evaluator = null, object onInstance = null)
-        {
-            MethodInfo = methodInfo;
-            ParameterType = parameterType;
-            OriginalArg = originalArg;
-            Evaluator = evaluator;
-            This = onInstance;
-            ArgPosition = argPosition;
-        }
-
-        private object modifiedArgument;
-
-        /// <summary>
-        /// To set the modified argument
-        /// </summary>
-        public object Argument
-        {
-            get { return modifiedArgument; }
-            set
-            {
-                modifiedArgument = value;
-                FunctionModifiedArgument = true;
-            }
-        }
-
-        /// <summary>
-        /// if <c>true</c> the argument has been modified, if <c>false</c> it means that the argument can't be of the given type.
-        /// </summary>
-        public bool FunctionModifiedArgument { get; set; }
-    }
-
-    #endregion
 }
\ No newline at end of file
diff --git a/CodingSeb.ExpressionEvaluator/Operators/ExpressionOperator.cs b/CodingSeb.ExpressionEvaluator/Operators/ExpressionOperator.cs
new file mode 100644
index 0000000..0a64d3b
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Operators/ExpressionOperator.cs
@@ -0,0 +1,64 @@
+﻿using System;
+
+namespace CodingSeb.ExpressionEvaluator.Operators
+{
+    /// <summary>
+    /// Inherit from this class to define your own simple operator
+    /// </summary>
+    public partial class ExpressionOperator : IEquatable<ExpressionOperator>
+    {
+        protected static uint indexer;
+
+        protected ExpressionOperator()
+        {
+            indexer++;
+            OperatorValue = indexer;
+        }
+
+        protected uint OperatorValue { get; }
+
+        public static readonly ExpressionOperator Plus = new ExpressionOperator();
+        public static readonly ExpressionOperator Minus = new ExpressionOperator();
+        public static readonly ExpressionOperator UnaryPlus = new ExpressionOperator();
+        public static readonly ExpressionOperator UnaryMinus = new ExpressionOperator();
+        public static readonly ExpressionOperator Multiply = new ExpressionOperator();
+        public static readonly ExpressionOperator Divide = new ExpressionOperator();
+        public static readonly ExpressionOperator Modulo = new ExpressionOperator();
+        public static readonly ExpressionOperator Lower = new ExpressionOperator();
+        public static readonly ExpressionOperator Greater = new ExpressionOperator();
+        public static readonly ExpressionOperator Equal = new ExpressionOperator();
+        public static readonly ExpressionOperator LowerOrEqual = new ExpressionOperator();
+        public static readonly ExpressionOperator GreaterOrEqual = new ExpressionOperator();
+        public static readonly ExpressionOperator Is = new ExpressionOperator();
+        public static readonly ExpressionOperator NotEqual = new ExpressionOperator();
+        public static readonly ExpressionOperator LogicalNegation = new ExpressionOperator();
+        public static readonly ExpressionOperator BitwiseComplement = new ExpressionOperator();
+        public static readonly ExpressionOperator ConditionalAnd = new ExpressionOperator();
+        public static readonly ExpressionOperator ConditionalOr = new ExpressionOperator();
+        public static readonly ExpressionOperator LogicalAnd = new ExpressionOperator();
+        public static readonly ExpressionOperator LogicalOr = new ExpressionOperator();
+        public static readonly ExpressionOperator LogicalXor = new ExpressionOperator();
+        public static readonly ExpressionOperator ShiftBitsLeft = new ExpressionOperator();
+        public static readonly ExpressionOperator ShiftBitsRight = new ExpressionOperator();
+        public static readonly ExpressionOperator NullCoalescing = new ExpressionOperator();
+        public static readonly ExpressionOperator Cast = new ExpressionOperator();
+
+        public override bool Equals(object obj)
+        {
+            if (obj is ExpressionOperator otherOperator)
+                return Equals(otherOperator);
+            else
+                return OperatorValue.Equals(obj);
+        }
+
+        public override int GetHashCode()
+        {
+            return OperatorValue.GetHashCode();
+        }
+
+        public bool Equals(ExpressionOperator otherOperator)
+        {
+            return otherOperator != null && OperatorValue == otherOperator.OperatorValue;
+        }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/Operators/OperatorsEvaluationsExtensions.cs b/CodingSeb.ExpressionEvaluator/Operators/OperatorsEvaluationsExtensions.cs
new file mode 100644
index 0000000..c07e0ab
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/Operators/OperatorsEvaluationsExtensions.cs
@@ -0,0 +1,87 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace CodingSeb.ExpressionEvaluator.Operators
+{
+    /// <summary>
+    /// This class provides extensions methods to easily customize operators list.
+    /// </summary>
+    public static partial class OperatorsEvaluationsExtensions
+    {
+        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> Copy(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations)
+        {
+            return operatorsEvaluations
+                .Select(dic => (IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>)new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>>(dic))
+                .ToList();
+        }
+
+        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtLevelOf(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, ExpressionOperator levelOfThisOperator)
+        {
+            operatorsEvaluations
+                .First(dict => dict.ContainsKey(levelOfThisOperator))
+                .Add(operatorToAdd, evaluation);
+
+            return operatorsEvaluations;
+        }
+
+        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtLevel(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, int level)
+        {
+            operatorsEvaluations[level]
+                .Add(operatorToAdd, evaluation);
+
+            return operatorsEvaluations;
+        }
+
+        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtNewLevelAfter(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, ExpressionOperator levelOfThisOperator)
+        {
+            int level = operatorsEvaluations
+                .IndexOf(operatorsEvaluations.First(dict => dict.ContainsKey(levelOfThisOperator)));
+
+            operatorsEvaluations
+                .Insert(level + 1, new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>> { { operatorToAdd, evaluation } });
+
+            return operatorsEvaluations;
+        }
+
+        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtNewLevelBefore(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, ExpressionOperator levelOfThisOperator)
+        {
+            int level = operatorsEvaluations
+                .IndexOf(operatorsEvaluations.First(dict => dict.ContainsKey(levelOfThisOperator)));
+
+            operatorsEvaluations
+                .Insert(level, new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>> { { operatorToAdd, evaluation } });
+
+            return operatorsEvaluations;
+        }
+
+        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> AddOperatorEvaluationAtNewLevel(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToAdd, Func<dynamic, dynamic, object> evaluation, int level)
+        {
+            operatorsEvaluations
+                .Insert(level, new Dictionary<ExpressionOperator, Func<dynamic, dynamic, object>> { { operatorToAdd, evaluation } });
+
+            return operatorsEvaluations;
+        }
+
+        public static IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> RemoveOperatorEvaluation(this IList<IDictionary<ExpressionOperator, Func<dynamic, dynamic, object>>> operatorsEvaluations, ExpressionOperator operatorToRemove)
+        {
+            operatorsEvaluations.First(dict => dict.ContainsKey(operatorToRemove)).Remove(operatorToRemove);
+
+            return operatorsEvaluations;
+        }
+
+        public static IList<ExpressionOperator> FluidAdd(this IList<ExpressionOperator> listOfOperator, ExpressionOperator operatorToAdd)
+        {
+            listOfOperator.Add(operatorToAdd);
+
+            return listOfOperator;
+        }
+
+        public static IList<ExpressionOperator> FluidRemove(this IList<ExpressionOperator> listOfOperator, ExpressionOperator operatorToRemove)
+        {
+            listOfOperator.Remove(operatorToRemove);
+
+            return listOfOperator;
+        }
+    }
+}
diff --git a/CodingSeb.ExpressionEvaluator/SubExpression.cs b/CodingSeb.ExpressionEvaluator/SubExpression.cs
new file mode 100644
index 0000000..44d4813
--- /dev/null
+++ b/CodingSeb.ExpressionEvaluator/SubExpression.cs
@@ -0,0 +1,15 @@
+﻿namespace CodingSeb.ExpressionEvaluator
+{
+    /// <summary>
+    /// Allow to store sub expression in variables. To compose a bigger expression with variable evaluate as expressions and not string
+    /// </summary>
+    public partial class SubExpression
+    {
+        public string Expression { get; set; }
+
+        public SubExpression(string expression)
+        {
+            Expression = expression;
+        }
+    }
+}

From f48f83c2bd46d5b24d48b82b5a3d2a98bdf32cf9 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Fri, 4 Jun 2021 15:52:42 +0200
Subject: [PATCH 46/48] List for simplified collection in trywindow

---
 TryWindow/MainWindow.xaml.cs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/TryWindow/MainWindow.xaml.cs b/TryWindow/MainWindow.xaml.cs
index e467f3d..598cf38 100644
--- a/TryWindow/MainWindow.xaml.cs
+++ b/TryWindow/MainWindow.xaml.cs
@@ -51,6 +51,7 @@ private async void CalculateButton_Click(object sender, RoutedEventArgs e)
                 evaluator.OptionsSyntaxRules.InitializerPropertyValueSeparators = new[] { "=", ":" };
                 evaluator.OptionsSyntaxRules.InitializerAllowStringForProperties = true;
                 evaluator.OptionsSyntaxRules.AllowSimplifiedCollectionSyntax = true;
+                evaluator.OptionsSyntaxRules.SimplifiedCollectionMode = SimplifiedCollectionMode.List;
             }
 
             if (UseCachesCheckbox.IsChecked ?? false)

From 87b3fe2b08ebcb0c918bdd201f18d5c928524317 Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 29 Jun 2021 10:36:43 +0200
Subject: [PATCH 47/48] Version 1.5.0-alpha0002

---
 .../CodingSeb.ExpressionEvaluator.csproj                       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj b/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
index 6b6b51b..9e8fe27 100644
--- a/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
+++ b/CodingSeb.ExpressionEvaluator/CodingSeb.ExpressionEvaluator.csproj
@@ -22,7 +22,8 @@ Syntax is easily customizable</Description>
     <PackageIcon>Icon.png</PackageIcon>
     <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
     <PackageReleaseNotes>* Some prerelease syntax customization features to test it live
-!!! Warning breaking changes !!!</PackageReleaseNotes>
+!!! Warning breaking changes !!!
+Include last bug corrections of v. 1.4.30</PackageReleaseNotes>
     <PackageLicenseFile>LICENSE.md</PackageLicenseFile>
     <RepositoryUrl>https://github.com/codingseb/ExpressionEvaluator</RepositoryUrl>
   </PropertyGroup>

From 0c9f4603e21af57c6d6eea0b8836d50f42c4d9bc Mon Sep 17 00:00:00 2001
From: CodingSeb <sebgeiser@gmail.com>
Date: Tue, 29 Jun 2021 14:59:03 +0200
Subject: [PATCH 48/48] Add namespaces in Tests

---
 .../ExpressionEvaluatorScriptEvaluateTests.cs                 | 1 +
 .../ExpressionEvaluatorTests.cs                               | 4 +++-
 .../TestsUtils/XExpressionEvaluator1.cs                       | 4 +++-
 .../TestsUtils/XExpressionEvaluator2.cs                       | 3 ++-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
index 6abb252..f7b6787 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorScriptEvaluateTests.cs
@@ -4,6 +4,7 @@
 using System.Text.RegularExpressions;
 using Newtonsoft.Json;
 using Shouldly;
+using CodingSeb.ExpressionEvaluator.Exceptions;
 
 namespace CodingSeb.ExpressionEvaluator.Tests
 {
diff --git a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
index 1df2163..20a1868 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs
@@ -1,4 +1,6 @@
-﻿using Newtonsoft.Json;
+﻿using CodingSeb.ExpressionEvaluator.Containers;
+using CodingSeb.ExpressionEvaluator.Exceptions;
+using Newtonsoft.Json;
 using NUnit.Framework;
 using Shouldly;
 using System;
diff --git a/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/XExpressionEvaluator1.cs b/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/XExpressionEvaluator1.cs
index c0bb3fe..27681d5 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/XExpressionEvaluator1.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/XExpressionEvaluator1.cs
@@ -1,4 +1,6 @@
-﻿namespace CodingSeb.ExpressionEvaluator.Tests
+﻿using CodingSeb.ExpressionEvaluator.Operators;
+
+namespace CodingSeb.ExpressionEvaluator.Tests
 {
     public class XExpressionEvaluator1 : ExpressionEvaluator
     {
diff --git a/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/XExpressionEvaluator2.cs b/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/XExpressionEvaluator2.cs
index ca9ad7b..f5047fc 100644
--- a/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/XExpressionEvaluator2.cs
+++ b/CodingSeb.ExpressionEvaluator.Tests/TestsUtils/XExpressionEvaluator2.cs
@@ -1,4 +1,5 @@
-﻿using System;
+﻿using CodingSeb.ExpressionEvaluator.Operators;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 
