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,

View File

@ -3,7 +3,7 @@ import os
import os.path
from glob import glob
RUN_JSONCHECKER = True
RUN_JSONCHECKER = False
def compareOutputs( expected, actual, message ):
expected = expected.strip().replace('\r','').split('\n')

View File

@ -0,0 +1,8 @@
.={}
.test=[]
.test[0]={}
.test[0].a="aaa"
.test[1]={}
.test[1].b="bbb"
.test[2]={}
.test[2].c="ccc"

View File

@ -0,0 +1,8 @@
{
"test":
[
{ "a" : "aaa" }, // Comment for a
{ "b" : "bbb" }, // Comment for b
{ "c" : "ccc" } // Comment for c
]
}