mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
b26dbf08cc
commit
dbf7dfe7da
@ -292,12 +292,12 @@ static bool is_unicode_Lo_char(uint32_t c) {
|
||||
char* p_end;
|
||||
|
||||
try{
|
||||
float_out = std::strtod(text.begin(), &p_end);
|
||||
float_out = std::strtod(text.data(), &p_end);
|
||||
}catch(...){
|
||||
SyntaxError("invalid number literal");
|
||||
}
|
||||
|
||||
if(p_end == text.end()){
|
||||
if(p_end == text.data() + text.size()){
|
||||
add_token(TK("@num"), (f64)float_out);
|
||||
return;
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ void init_builtins(VM* _vm) {
|
||||
double float_out;
|
||||
char* p_end;
|
||||
try{
|
||||
float_out = std::strtod(s.begin(), &p_end);
|
||||
float_out = std::strtod(s.data, &p_end);
|
||||
PK_ASSERT(p_end == s.end());
|
||||
}catch(...){
|
||||
vm->ValueError("invalid literal for float(): " + s.escape());
|
||||
|
Loading…
x
Reference in New Issue
Block a user