in src/Microsoft.Diagnostics.Runtime/Implementation/DACNameParser.cs [960:1020]
private static (ParsingState State, int Pos) DetermineNextStateAndPos(string name, int curPos)
{
if (curPos == name.Length)
return (ParsingState.Done, curPos);
switch (name[curPos])
{
case ArgSeparator:
{
curPos++; // move past the comma
int potentiallyNewPos = MoveCurPosPastWhitespaceOrFail(name, curPos);
if (potentiallyNewPos < 0)
{
return (ParsingState.Error, curPos);
}
curPos = potentiallyNewPos;
if (name[curPos] == GenericArgListAssemblyQualifiedTypeNameOrArrayStartSpecifier)
{
return (ParsingState.ParsingAssemblyQualifiedGenericArgName, curPos + 1);
}
else
{
return (ParsingState.ParsingNonAssemblyQualifiedGenericArgName, curPos);
}
}
case GenericAritySpecifier:
{
return (ParsingState.ParsingGenericArgCount, curPos + 1);
}
case NestedClassSpecifier:
{
return (ParsingState.ParsingNestedClass, curPos + 1);
}
case GenericArgListAssemblyQualifiedTypeNameOrArrayStartSpecifier:
{
if (curPos + 1 != name.Length)
{
if (name[curPos + 1] is GenericArgListAssemblyQualifiedTypeNameOrArrayEndSpecifier or ArgSeparator)
return (ParsingState.ParsingArraySpecifier, curPos);
else
return (ParsingState.ParsingGenericArgs, curPos);
}
return (ParsingState.Error, curPos);
}
case GenericArgListAssemblyQualifiedTypeNameOrArrayEndSpecifier:
{
if (curPos != name.Length)
{
return (ParsingState.ResolveParsedGenericList, curPos + 1);
}
return (ParsingState.Error, curPos);
}
default:
return (ParsingState.Error, curPos);
}
}