mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
locale independent util::parse_double
This commit is contained in:
parent
84e8fd1af6
commit
bc72742ee3
20 changed files with 140 additions and 48 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue