Clear the stack after parsing and fixes indentation.
This commit is contained in:
parent
74a24377a8
commit
188b99b471
@ -240,9 +240,9 @@ public:
|
|||||||
RAPIDJSON_PARSE_ERROR_NORETURN("Text only contains white space(s)", is.Tell());
|
RAPIDJSON_PARSE_ERROR_NORETURN("Text only contains white space(s)", is.Tell());
|
||||||
else {
|
else {
|
||||||
switch (is.Peek()) {
|
switch (is.Peek()) {
|
||||||
case '{': ParseObject<parseFlags>(is, handler); break;
|
case '{': ParseObject<parseFlags>(is, handler); break;
|
||||||
case '[': ParseArray<parseFlags>(is, handler); break;
|
case '[': ParseArray<parseFlags>(is, handler); break;
|
||||||
default: RAPIDJSON_PARSE_ERROR_NORETURN("Expect either an object or array at root", is.Tell());
|
default: RAPIDJSON_PARSE_ERROR_NORETURN("Expect either an object or array at root", is.Tell());
|
||||||
}
|
}
|
||||||
SkipWhitespace(is);
|
SkipWhitespace(is);
|
||||||
|
|
||||||
@ -250,6 +250,7 @@ public:
|
|||||||
RAPIDJSON_PARSE_ERROR_NORETURN("Nothing should follow the root object or array.", is.Tell());
|
RAPIDJSON_PARSE_ERROR_NORETURN("Nothing should follow the root object or array.", is.Tell());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stack_.Clear();
|
||||||
return !HasParseError();
|
return !HasParseError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user