This commit is contained in:
blueloveTH 2022-12-30 21:11:31 +08:00
parent 3d610e4fdc
commit fcdff94be3
6 changed files with 27 additions and 14 deletions

View File

@ -1,4 +1,4 @@
## 0.6.0+3
## 0.6.0+4
+ Break change

View File

@ -50,7 +50,8 @@ class _MyAppState extends State<MyApp> {
buffer.write(needMoreLines ? '... $text' : '>>> $text\n');
});
if (text == "exit()") exit(0);
needMoreLines = repl.input(text) == 0;
repl.input(text);
needMoreLines = repl.last_input_result() == 0;
refresh();
}

View File

@ -1,6 +1,6 @@
name: pocketpy
description: A lightweight Python interpreter for game engines.
version: 0.6.0+3
version: 0.6.0+4
homepage: https://pocketpy.dev
repository: https://github.com/blueloveth/pocketpy

View File

@ -4278,13 +4278,12 @@ public:
void sleepForSecs(_Float sec){
_Int ms = (_Int)(sec * 1000);
const _Int step = 20;
for(_Int i=0; i<ms; i+=step){
for(_Int i=0; i<ms; i+=20){
_checkStopFlag();
#ifdef __EMSCRIPTEN__
emscripten_sleep(step);
emscripten_sleep(20);
#else
std::this_thread::sleep_for(std::chrono::milliseconds(step));
std::this_thread::sleep_for(std::chrono::milliseconds(20));
#endif
}
}
@ -5026,7 +5025,14 @@ public:
void suspend(){
if(_state != THREAD_RUNNING) UNREACHABLE();
_state = THREAD_SUSPENDED;
while(_state == THREAD_SUSPENDED) _checkStopFlag();
while(_state == THREAD_SUSPENDED){
_checkStopFlag();
#ifdef __EMSCRIPTEN__
emscripten_sleep(20);
#else
std::this_thread::sleep_for(std::chrono::milliseconds(20));
#endif
}
}
_Str readJsonRpcRequest(){

@ -1 +1 @@
Subproject commit ac067d7f1f84cb757db20ffb3c929d880053c6c1
Subproject commit ed849abe8ed709eb7e378d39f4b8709e4ff9667f

View File

@ -378,13 +378,12 @@ public:
void sleepForSecs(_Float sec){
_Int ms = (_Int)(sec * 1000);
const _Int step = 20;
for(_Int i=0; i<ms; i+=step){
for(_Int i=0; i<ms; i+=20){
_checkStopFlag();
#ifdef __EMSCRIPTEN__
emscripten_sleep(step);
emscripten_sleep(20);
#else
std::this_thread::sleep_for(std::chrono::milliseconds(step));
std::this_thread::sleep_for(std::chrono::milliseconds(20));
#endif
}
}
@ -1126,7 +1125,14 @@ public:
void suspend(){
if(_state != THREAD_RUNNING) UNREACHABLE();
_state = THREAD_SUSPENDED;
while(_state == THREAD_SUSPENDED) _checkStopFlag();
while(_state == THREAD_SUSPENDED){
_checkStopFlag();
#ifdef __EMSCRIPTEN__
emscripten_sleep(20);
#else
std::this_thread::sleep_for(std::chrono::milliseconds(20));
#endif
}
}
_Str readJsonRpcRequest(){