locale independent util::parse_double

This commit is contained in:
MihailRis
2024-02-02 20:02:30 +03:00
parent 84e8fd1af6
commit bc72742ee3
20 changed files with 140 additions and 48 deletions
+13
View File
@@ -41,6 +41,19 @@ inline bool is_identifier_part(int c) {
return is_identifier_start(c) || is_digit(c);
}
inline int hexchar2int(int c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'a' && c <= 'f') {
return 10 + c - 'a';
}
if (c >= 'A' && c <= 'F') {
return 10 + c - 'A';
}
return -1;
}
extern std::string escape_string(std::string s);
class parsing_error : public std::runtime_error {