// look for a subsequent semicolon that ends it.
// If it doesn't exist, report a problem.
semicolonIndex = s.indexOf(SEMICOLON, ampersandIndex + 1);
if (semicolonIndex == -1)
{
ICompilerProblem problem = new MXMLUnterminatedEntityProblem(location);
problems.add(problem);
break; // we can't do any further processing
}
// Extract and convert the entity between the ampersand and the semicolon.
String physicalText = s.substring(ampersandIndex, semicolonIndex + 1);
String entityName = s.substring(ampersandIndex + 1, semicolonIndex);
int c = convertEntity(entityName, mxmlDialect);
if (c == -1)
{
// If it doesn't convert to a character, create a problem and return null.
ICompilerProblem problem = new MXMLInvalidEntityProblem(location, physicalText);
problems.add(problem);
}
else
{
// If it does convert, add a fragment for the entity.