mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add YAML parser
This commit is contained in:
parent
239181bb64
commit
2aea19febd
8 changed files with 406 additions and 25 deletions
|
|
@ -16,16 +16,6 @@ using namespace toml;
|
|||
class TomlReader : BasicParser<char> {
|
||||
dv::value root;
|
||||
|
||||
void skipWhitespace() override {
|
||||
BasicParser::skipWhitespace();
|
||||
if (hasNext() && source[pos] == '#') {
|
||||
skipLine();
|
||||
if (hasNext() && is_whitespace(peek())) {
|
||||
skipWhitespace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// modified version of BaseParser.parseString
|
||||
// todo: extract common part
|
||||
std::string parseMultilineString() {
|
||||
|
|
@ -214,6 +204,7 @@ class TomlReader : BasicParser<char> {
|
|||
public:
|
||||
TomlReader(std::string_view file, std::string_view source)
|
||||
: BasicParser(file, source), root(dv::object()) {
|
||||
hashComment = true;
|
||||
}
|
||||
|
||||
dv::value read() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue