add YAML parser

This commit is contained in:
MihailRis
2025-03-23 08:49:09 +03:00
parent 239181bb64
commit 2aea19febd
8 changed files with 406 additions and 25 deletions
+1 -10
View File
@@ -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() {