mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
print(a) not ok
This commit is contained in:
parent
7d0c6c8148
commit
ffc9d32cf0
@ -36,8 +36,9 @@ void block_setBody(PikaObj *self, char *body)
|
|||||||
uint8_t block_checkAssert(PikaObj *self)
|
uint8_t block_checkAssert(PikaObj *self)
|
||||||
{
|
{
|
||||||
Args *buffs = New_strBuff();
|
Args *buffs = New_strBuff();
|
||||||
|
PikaObj *host = obj_getContext(self);
|
||||||
char *assert = block_getAssert(self);
|
char *assert = block_getAssert(self);
|
||||||
obj_run(self, strsFormat(buffs, 32, "_res = %s", assert));
|
obj_run(host, strsFormat(buffs, 32, "_res = %s", assert));
|
||||||
int res = obj_getInt(self, "_res");
|
int res = obj_getInt(self, "_res");
|
||||||
args_deinit(buffs);
|
args_deinit(buffs);
|
||||||
return res;
|
return res;
|
||||||
|
@ -231,8 +231,7 @@ Args *obj_invoke(PikaObj *self, char *cmd)
|
|||||||
Args *res = New_args(NULL);
|
Args *res = New_args(NULL);
|
||||||
args_setErrorCode(res, 0);
|
args_setErrorCode(res, 0);
|
||||||
Args *buffs = New_strBuff();
|
Args *buffs = New_strBuff();
|
||||||
char *cleanCmd = strsGetCleanCmd(buffs, cmd);
|
char *methodToken = strsGetFirstToken(buffs, cmd, '(');
|
||||||
char *methodToken = strsGetFirstToken(buffs, cleanCmd, '(');
|
|
||||||
char *methodPath = methodToken;
|
char *methodPath = methodToken;
|
||||||
Args *args = NULL;
|
Args *args = NULL;
|
||||||
|
|
||||||
@ -277,7 +276,7 @@ Args *obj_invoke(PikaObj *self, char *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get arg list */
|
/* get arg list */
|
||||||
char *argList = strsCut(buffs, cleanCmd, '(', ')');
|
char *argList = strsCut(buffs, cmd, '(', ')');
|
||||||
{
|
{
|
||||||
if (argList == NULL)
|
if (argList == NULL)
|
||||||
{
|
{
|
||||||
|
@ -574,14 +574,15 @@ Args *getRightRes(PikaObj *self, char *cmd)
|
|||||||
}
|
}
|
||||||
res = New_args(NULL);
|
res = New_args(NULL);
|
||||||
args_setSysOut(res, "");
|
args_setSysOut(res, "");
|
||||||
int err = args_setLiteral(res, "return", cmd);
|
int err = obj_getAnyArg(self, "return", cmd, res);
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
{
|
{
|
||||||
args_setSysOut(res, "[error] get value faild.");
|
args_setSysOut(res, "[error] get value faild.");
|
||||||
args_setErrorCode(res, 1);
|
args_setErrorCode(res, 1);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
char *returnType = strsAppend(buffs, "->", args_getType(res, "return"));
|
char *returnType = args_getType(res, "return");
|
||||||
|
returnType = strsAppend(buffs, "->", returnType);
|
||||||
args_setStr(res, "returnType", returnType);
|
args_setStr(res, "returnType", returnType);
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
@ -594,6 +595,7 @@ Args *obj_runScript(PikaObj *self, char *cmd)
|
|||||||
{
|
{
|
||||||
Args *buffs = New_strBuff();
|
Args *buffs = New_strBuff();
|
||||||
Args *res = NULL;
|
Args *res = NULL;
|
||||||
|
cmd = strsGetCleanCmd(buffs, cmd);
|
||||||
|
|
||||||
/* get right cmd */
|
/* get right cmd */
|
||||||
char *right = getRightCmd(buffs, cmd);
|
char *right = getRightCmd(buffs, cmd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user