mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add array as root element support to json parser
This commit is contained in:
parent
cf77da3bd1
commit
572ae9fa39
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() {
|
||||
char next = peek();
|
||||
if (next != '{') {
|
||||
throw error("'{' expected");
|
||||
if (next == '{') {
|
||||
return parseObject();
|
||||
} else if (next == '[') {
|
||||
return parseList();
|
||||
}
|
||||
return parseObject();
|
||||
throw error("'{' or '[' expected");
|
||||
}
|
||||
|
||||
dv::value Parser::parseObject() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue