Fixed comment after value in object value signaled by Frederic Surleau.

This commit is contained in:
Baptiste Lepilleur
2009-11-18 22:25:34 +00:00
parent 8868147835
commit f179a180bd
4 changed files with 26 additions and 4 deletions

View File

@@ -557,9 +557,15 @@ Reader::readArray( Token &tokenStart )
return recoverFromError( tokenArrayEnd );
Token token;
if ( !readToken( token )
|| ( token.type_ != tokenArraySeparator &&
token.type_ != tokenArrayEnd ) )
// Accept Comment after last item in the array.
ok = readToken( token );
while ( token.type_ == tokenComment && ok )
{
ok = readToken( token );
}
bool badTokenType = ( token.type_ == tokenArraySeparator &&
token.type_ == tokenArrayEnd );
if ( !ok || badTokenType )
{
return addErrorAndRecover( "Missing ',' or ']' in array declaration",
token,