// appear in the error message.
final ASToken current = buffer.lookAheadSkipInsertedSemicolon();
final ICompilerProblem syntaxProblem;
if (ex instanceof MismatchedTokenException)
{
final ASTokenKind expectedKind = ASToken.typeToKind(((MismatchedTokenException)ex).expecting);
syntaxProblem = unexpectedTokenProblem(current, expectedKind);
}
else if (endToken != NO_END_TOKEN)
{
final ASTokenKind expectedKind = ASToken.typeToKind(endToken);
syntaxProblem = unexpectedTokenProblem(current, expectedKind);
}
else
{
final ASToken errorToken = current.getType() == EOF ? buffer.previous() : current;