feat: toml lvalues support

This commit is contained in:
MihailRis
2024-10-12 00:23:52 +03:00
parent 66825d62aa
commit d14548cff8
7 changed files with 83 additions and 58 deletions
+12 -4
View File
@@ -221,10 +221,6 @@ std::string_view BasicParser::readUntilEOL() {
std::string BasicParser::parseName() {
char c = peek();
if (!is_identifier_start(c)) {
if (c == '"') {
pos++;
return parseString(c);
}
throw error("identifier expected");
}
int start = pos;
@@ -234,6 +230,18 @@ std::string BasicParser::parseName() {
return std::string(source.substr(start, pos - start));
}
std::string BasicParser::parseXmlName() {
char c = peek();
if (!is_json_identifier_start(c)) {
throw error("identifier expected");
}
int start = pos;
while (hasNext() && is_json_identifier_part(source[pos])) {
pos++;
}
return std::string(source.substr(start, pos - start));
}
int64_t BasicParser::parseSimpleInt(int base) {
char c = peek();
int index = hexchar2int(c);