mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
feat: toml lvalues support
This commit is contained in:
parent
66825d62aa
commit
d14548cff8
7 changed files with 83 additions and 58 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue