/// <summary> /// Removes all custom functions. /// </summary> public void RemoveAllFunctions() { foreach (string func in FunctionsDict.Keys) { Tokenizer.TokenDict.Remove(func); } FunctionsDict.Clear(); }
/// <summary> /// Removes a custom function. /// </summary> /// <param name="name">The name of the custom function to be removed.</param> public void RemoveFunction(string name) { if (!FunctionsDict.Keys.Contains(name)) { throw new ArgumentException($"No function named '{name}' was found."); } Tokenizer.TokenDict.Remove(name); FunctionsDict.Remove(name); }
private void addFuncHelper(string name, ArrayFunc func, int paramNum = -1) { if (variables.ContainsKey(name) || !var_match(name)) { throw new ArgumentException($"Given function name '{name}' is either invalid or already exists."); } FunctionsDict.Add(name, func); Tokenizer.TokenDict.Add(name, new Tuple <Type, int>(typeof(CallerFuncToken), paramNum)); }