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
+5 -1
View File
@@ -7,16 +7,20 @@ template <typename CharT>
class BasicParser {
using StringT = std::basic_string<CharT>;
using StringViewT = std::basic_string_view<CharT>;
void skipWhitespaceHashComment(bool newline = true);
protected:
std::string_view filename;
StringViewT source;
uint pos = 0;
uint line = 1;
uint linestart = 0;
bool hashComment = false;
virtual void skipWhitespace();
void skipWhitespace(bool newline = true);
void skip(size_t n);
void skipLine();
void skipEmptyLines();
bool skipTo(const StringT& substring);
void expect(CharT expected);
void expect(const StringT& substring);