diff --git a/src/core/InputInterpreter.cs b/src/core/InputInterpreter.cs index bd409a4..d631ccf 100644 --- a/src/core/InputInterpreter.cs +++ b/src/core/InputInterpreter.cs @@ -26,10 +26,10 @@ namespace csmic public InputInterpreter() { - numericVariables = new(StringComparer.Ordinal); - numericArrayVariables = new(StringComparer.Ordinal); - expressionVariables = new(StringComparer.Ordinal); - functions = new(StringComparer.Ordinal); + numericVariables = new Dictionary(StringComparer.Ordinal); + numericArrayVariables = new Dictionary(StringComparer.Ordinal); + expressionVariables = new Dictionary(StringComparer.Ordinal); + functions = new Dictionary(StringComparer.Ordinal); } // Internal constructor to create a child interpreter that shares stores diff --git a/src/core/cocor/Interpreter.atg b/src/core/cocor/Interpreter.atg index 5d19d0d..d8c437b 100644 --- a/src/core/cocor/Interpreter.atg +++ b/src/core/cocor/Interpreter.atg @@ -307,7 +307,7 @@ Function . ArgList - (. List list = new List(); FunctionArgument a = new FunctionArgument { Name = string.Empty, Value = new FunctionValue() }; args = new FunctionArgument[0]; .) + (. List list = new List(); FunctionArgument a = new FunctionArgument(string.Empty, new FunctionValue()); args = new FunctionArgument[0]; .) = [ Arg (. list.Add(a); args = list.ToArray(); .) @@ -316,12 +316,12 @@ ArgList . Arg - (. arg = new FunctionArgument { Name = string.Empty, Value = new FunctionValue() }; decimal r = 0; string s = string.Empty; .) + (. arg = new FunctionArgument(string.Empty, new FunctionValue()); decimal r = 0; string s = string.Empty; .) = ( - string (. s = t.val.Substring(1, t.val.Length - 2); arg = new FunctionArgument { Name = string.Empty, Value = new FunctionValue(ValueType.String, s) }; .) + string (. s = t.val.Substring(1, t.val.Length - 2); arg = new FunctionArgument(string.Empty, new FunctionValue(ValueType.String, s)); .) | - Expression (. arg = new FunctionArgument { Name = string.Empty, Value = new FunctionValue(ValueType.Numeric, r) }; .) + Expression (. arg = new FunctionArgument(string.Empty, new FunctionValue(ValueType.Numeric, r)); .) ) .