mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20: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;
|
char* p_end;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
float_out = std::strtod(text.begin(), &p_end);
|
float_out = std::strtod(text.data(), &p_end);
|
||||||
}catch(...){
|
}catch(...){
|
||||||
SyntaxError("invalid number literal");
|
SyntaxError("invalid number literal");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(p_end == text.end()){
|
if(p_end == text.data() + text.size()){
|
||||||
add_token(TK("@num"), (f64)float_out);
|
add_token(TK("@num"), (f64)float_out);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -502,7 +502,7 @@ void init_builtins(VM* _vm) {
|
|||||||
double float_out;
|
double float_out;
|
||||||
char* p_end;
|
char* p_end;
|
||||||
try{
|
try{
|
||||||
float_out = std::strtod(s.begin(), &p_end);
|
float_out = std::strtod(s.data, &p_end);
|
||||||
PK_ASSERT(p_end == s.end());
|
PK_ASSERT(p_end == s.end());
|
||||||
}catch(...){
|
}catch(...){
|
||||||
vm->ValueError("invalid literal for float(): " + s.escape());
|
vm->ValueError("invalid literal for float(): " + s.escape());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user