enum E
{
VALUE1 = 20somegarbage,
VALUE2 = 30moregarbage
}
The application will compile and run without any error. But it should throw some "bad suffix on number" error information.
I think that the problem is in as_tokenizer.cpp in method:
bool asCTokenizer::IsConstant(const char *source, size_t sourceLength, size_t &tokenLength, eTokenType &tokenType) const
which identifies "20somegarbage" and "30moregarbage" as ttIntConstant. In this loop:
size_t n;
for( n = 0; n < sourceLength; n++ )
{
if( source[n] < '0' || source[n] > '9' )
break;
}
it only goes to first unallowed char (in this case "s" for the VALUE1) and does nothing about the fact that 20somegarbage is not a proper constant identifier here.
For this test I'm using HEAD revision (currently 1301), but this error is present in earlier versions of the AngelScript library.
Thanks in advance!