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 -9
View File
@@ -40,18 +40,10 @@ const std::string& langs::Lang::getId() const {
/// @brief Language key-value txt files parser
namespace {
class Reader : BasicParser<char> {
void skipWhitespace() override {
BasicParser::skipWhitespace();
if (hasNext() && source[pos] == '#') {
skipLine();
if (hasNext() && is_whitespace(peek())) {
skipWhitespace();
}
}
}
public:
Reader(std::string_view file, std::string_view source)
: BasicParser(file, source) {
hashComment = true;
}
void read(langs::Lang& lang, const std::string &prefix) {