add YAML parser
This commit is contained in:
+1
-10
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user