private int ParseNumericCharRef(bool expand, StringBuilder internalSubsetBuilder, out EntityType entityType)
{
for (;;)
{
int newPos;
int charCount;
switch (newPos = ParseNumericCharRefInline(_ps.charPos, expand, internalSubsetBuilder, out charCount, out entityType))
{
case -2:
// read new characters in the buffer
if (ReadData() == 0)
{
Throw(SR.Xml_UnexpectedEOF);
}
Debug.Assert(_ps.chars[_ps.charPos] == '&');
continue;
default:
if (expand)
{
_ps.charPos = newPos - charCount;
}
return newPos;
}
}
}