mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
add array as root element support to json parser
This commit is contained in:
parent
16fac768c8
commit
3a4b77dafc
1 changed files with 5 additions and 3 deletions
|
|
@ -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();
|
||||||
|
} else if (next == '[') {
|
||||||
|
return parseList();
|
||||||
}
|
}
|
||||||
return parseObject();
|
throw error("'{' or '[' expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
dv::value Parser::parseObject() {
|
dv::value Parser::parseObject() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue