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
+11 -2
View File
@@ -30,14 +30,22 @@ inline bool is_whitespace(int c) {
}
inline bool is_identifier_start(int c) {
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' ||
c == '.';
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_';
}
inline bool is_identifier_part(int c) {
return is_identifier_start(c) || is_digit(c) || c == '-';
}
inline bool is_json_identifier_start(int c) {
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' ||
c == '.';
}
inline bool is_json_identifier_part(int c) {
return is_json_identifier_start(c) || is_digit(c) || c == '-';
}
inline int hexchar2int(int c) {
if (c >= '0' && c <= '9') {
return c - '0';
@@ -99,6 +107,7 @@ public:
std::string_view readUntil(char c);
std::string_view readUntilEOL();
std::string parseName();
std::string parseXmlName();
bool hasNext();
char peek();
char peekInLine();