Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/bson/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,13 @@ namespace _bson {
if (eof()) {
return parseError("Field name expected");
}
//well formated json's fieldname started after space("\t" or " " or "\r\n")
//so we must try to find "\"" again
if (peekToken(DOUBLEQUOTE) || peekToken(SINGLEQUOTE)) {
// Quoted key
// TODO: make sure quoted field names cannot contain null characters
return quotedString(result);
}
if (!match(peek(), ALPHA "_$")) {
return parseError("First character in field must be [A-Za-z$_]");
}
Expand Down