mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
update core to v0.9 and add runEx for bsp
This commit is contained in:
parent
7d724ae5a4
commit
ac7665194c
@ -1,5 +1,6 @@
|
||||
pikascript-core==v0.8.3
|
||||
pikascript-core==v0.9.0
|
||||
PikaStdLib==latest
|
||||
PikaStdDevice==latest
|
||||
STM32==v1.1.1
|
||||
PikaMath==v1.0.0
|
||||
PikaMath==v1.0.0
|
||||
PikaRunExtern=1.0.0
|
@ -1,6 +1,7 @@
|
||||
pikascript-core==v0.8.3
|
||||
pikascript-core==v0.9.0
|
||||
PikaStdLib==latest
|
||||
PikaStdDevice==latest
|
||||
STM32==v1.1.1
|
||||
PikaPiZero==latest
|
||||
PikaMath==v1.0.0
|
||||
PikaRunExtern=1.0.0
|
@ -1,5 +1,6 @@
|
||||
pikascript-core==v0.8.3
|
||||
pikascript-core==v0.9.0
|
||||
PikaStdLib==latest
|
||||
PikaStdDevice==latest
|
||||
STM32==v1.1.1
|
||||
PikaMath==v1.0.0
|
||||
PikaMath==v1.0.0
|
||||
PikaRunExtern=1.0.0
|
@ -565,57 +565,21 @@ exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
PIKA_WEAK int __runExtern_contral(PikaObj* self, char* cmd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Args* obj_runDirect(PikaObj* self, char* cmd) {
|
||||
Args* buffs = New_strBuff();
|
||||
Args* res = NULL;
|
||||
cmd = strsDeleteChar(buffs, cmd, '\n');
|
||||
/* in block */
|
||||
if (NULL != obj_getArg(self, "_isInBlock")) {
|
||||
PikaObj* block = obj_getObj(self, "_block", 0);
|
||||
if (strIsStartWith(cmd, " ")) {
|
||||
if (strEqu(block_getMode(block), "if")) {
|
||||
if_pushLine(block, cmd);
|
||||
goto exit;
|
||||
}
|
||||
if (strEqu(block_getMode(block), "while")) {
|
||||
while_pushLine(block, cmd);
|
||||
goto exit;
|
||||
}
|
||||
goto exit;
|
||||
}
|
||||
/* the block is end */
|
||||
else {
|
||||
obj_removeArg(self, "_isInBlock");
|
||||
if (strEqu(block_getMode(block), "if")) {
|
||||
if_run(block);
|
||||
}
|
||||
if (strEqu(block_getMode(block), "while")) {
|
||||
while_run(block);
|
||||
}
|
||||
obj_removeArg(self, "_block");
|
||||
/* not finished */
|
||||
}
|
||||
}
|
||||
|
||||
/* if block */
|
||||
if (strIsStartWith(cmd, "if ")) {
|
||||
obj_setInt(self, "_isInBlock", 1);
|
||||
obj_setObjWithoutClass(self, "_block", block_init);
|
||||
PikaObj* block = obj_getObj(self, "_block", 0);
|
||||
if_setAssert(block, cmd);
|
||||
/* this line processed ok */
|
||||
/* contral extern */
|
||||
int isExit = __runExtern_contral(self, cmd);
|
||||
if (isExit) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* while block */
|
||||
if (strIsStartWith(cmd, "while ")) {
|
||||
obj_setInt(self, "_isInBlock", 1);
|
||||
obj_setObjWithoutClass(self, "_block", block_init);
|
||||
PikaObj* block = obj_getObj(self, "_block", 0);
|
||||
while_setAssert(block, cmd);
|
||||
/* this line processed ok */
|
||||
goto exit;
|
||||
}
|
||||
/* check class */
|
||||
if (strIsContain(cmd, '(') && strIsContain(cmd, ')') &&
|
||||
strIsContain(cmd, '=')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user