public IWorkshopTree[] ParseParameters(ScopeGroup getter, ScopeGroup scope, ParameterBase[] parameters, Node[] values, string methodName, LanguageServer.Location methodRange) { // Syntax error if there are too many parameters. if (values.Length > parameters.Length) { throw SyntaxErrorException.TooManyParameters(methodName, parameters.Length, values.Length, values[parameters.Length].Location); } // Parse the parameters List <IWorkshopTree> parsedParameters = new List <IWorkshopTree>(); for (int i = 0; i < parameters.Length; i++) { // Get the default parameter value if there are not enough parameters. if (values.Length <= i) { parsedParameters.Add(GetDefaultValue(parameters[i], methodName, methodRange)); } else { parsedParameters.Add(parameters[i].Parse(this, getter, scope, values[i])); } } return(parsedParameters.ToArray()); }