File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -557,9 +557,15 @@ Reader::readArray( Token &tokenStart )
557557 return recoverFromError ( tokenArrayEnd );
558558
559559 Token token;
560- if ( !readToken ( token )
561- || ( token.type_ != tokenArraySeparator &&
562- token.type_ != tokenArrayEnd ) )
560+ // Accept Comment after last item in the array.
561+ ok = readToken ( token );
562+ while ( token.type_ == tokenComment && ok )
563+ {
564+ ok = readToken ( token );
565+ }
566+ bool badTokenType = ( token.type_ == tokenArraySeparator &&
567+ token.type_ == tokenArrayEnd );
568+ if ( !ok || badTokenType )
563569 {
564570 return addErrorAndRecover ( " Missing ',' or ']' in array declaration" ,
565571 token,
Original file line number Diff line number Diff line change 33import os .path
44from glob import glob
55
6- RUN_JSONCHECKER = True
6+ RUN_JSONCHECKER = False
77
88def compareOutputs ( expected , actual , message ):
99 expected = expected .strip ().replace ('\r ' ,'' ).split ('\n ' )
Original file line number Diff line number Diff line change 1+ .={}
2+ .test=[]
3+ .test[0]={}
4+ .test[0].a="aaa"
5+ .test[1]={}
6+ .test[1].b="bbb"
7+ .test[2]={}
8+ .test[2].c="ccc"
Original file line number Diff line number Diff line change 1+ {
2+ "test" :
3+ [
4+ { "a" : " aaa" }, // Comment for a
5+ { "b" : " bbb" }, // Comment for b
6+ { "c" : " ccc" } // Comment for c
7+ ]
8+ }
You can’t perform that action at this time.
0 commit comments