add array as root element support to json parser
This commit is contained in:
parent
16fac768c8
commit
3a4b77dafc
@ -162,10 +162,12 @@ Parser::Parser(std::string_view filename, std::string_view source)
|
|||||||
|
|
||||||
dv::value Parser::parse() {
|
dv::value Parser::parse() {
|
||||||
char next = peek();
|
char next = peek();
|
||||||
if (next != '{') {
|
if (next == '{') {
|
||||||
throw error("'{' expected");
|
|
||||||
}
|
|
||||||
return parseObject();
|
return parseObject();
|
||||||
|
} else if (next == '[') {
|
||||||
|
return parseList();
|
||||||
|
}
|
||||||
|
throw error("'{' or '[' expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
dv::value Parser::parseObject() {
|
dv::value Parser::parseObject() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user