feat: toml lvalues support
This commit is contained in:
+12
-4
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user