private void GetMacroData(string s, SortedDictionary<int, Triplet<int, IMacro, string[]>> replace, ref int i, string name)
{
IMacro replacer;
IDictionary<int, IMacro> replacers;
bool isBuildIn = builtInValues.TryGetValue(name, out replacer);
bool isValue = values.TryGetValue(name, out replacers);
int paramLength;
string[] parameters;
if (isValue || isBuildIn)
{
if (i < s.Length && s[i] == '(')
{
parameters = GetParameters(s, i, out paramLength);
}
else
{
paramLength = 0;
parameters = new string[0];
}
if ((isBuildIn && replacer.IsCorrectAmountOfParameters(parameters.Length)) ||
(isValue && replacers.TryGetValue(parameters.Length, out replacer)))
{
replace[i - name.Length] = new Triplet<int, IMacro, string[]>
(paramLength + name.Length, replacer, parameters);
}
i += paramLength;
}
else i++;
}