Fixed bug #3139677: JSON [1 2 3] was incorrectly parsed as [1, 3]. Error is now correctly detected.

Modified runjsontests.py to allow test that expect failure in jsoncpp test suite.
This commit is contained in:
Baptiste Lepilleur
2011-05-01 15:40:47 +00:00
parent 565a1f3d39
commit 9c98f2277b
4 changed files with 10 additions and 4 deletions

View File

@@ -533,8 +533,8 @@ Reader::readArray( Token &tokenStart )
{
ok = readToken( token );
}
bool badTokenType = ( token.type_ == tokenArraySeparator &&
token.type_ == tokenArrayEnd );
bool badTokenType = ( token.type_ != tokenArraySeparator &&
token.type_ != tokenArrayEnd );
if ( !ok || badTokenType )
{
return addErrorAndRecover( "Missing ',' or ']' in array declaration",