mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
restore
This commit is contained in:
parent
930389306a
commit
b47e2795d1
@ -163,6 +163,7 @@ char* strsPopTokenWithSkip_byStr(Args* outBuffs,
|
||||
}
|
||||
|
||||
char* strsGetCleanCmd(Args* outBuffs, char* cmd) {
|
||||
pika_assert(cmd!=NULL);
|
||||
int32_t size = strGetSize(cmd);
|
||||
/* lexer may generate more chars than input */
|
||||
char* strOut = args_getBuff(outBuffs, size * 2);
|
||||
@ -1860,6 +1861,11 @@ AST* AST_parseLine(char* line, Stack* block_stack) {
|
||||
}
|
||||
|
||||
block_matched:
|
||||
if (NULL == stmt){
|
||||
AST_deinit(ast);
|
||||
ast = NULL;
|
||||
goto exit;
|
||||
}
|
||||
stmt = strsGetCleanCmd(&buffs, stmt);
|
||||
ast = AST_parseStmt(ast, stmt);
|
||||
goto exit;
|
||||
|
@ -1167,7 +1167,10 @@ static Arg* VM_instruction_handler_JEZ(PikaObj* self,
|
||||
int jmp_expect = fast_atoi(data);
|
||||
arg_newReg(pika_assertArg_reg, PIKA_ARG_BUFF_SIZE);
|
||||
Arg* pika_assertArg = stack_popArg(&(vs->stack), &pika_assertArg_reg);
|
||||
int pika_assert = arg_getInt(pika_assertArg);
|
||||
int pika_assert = 0;
|
||||
if (NULL != pika_assertArg) {
|
||||
pika_assert = arg_getInt(pika_assertArg);
|
||||
}
|
||||
arg_deinit(pika_assertArg);
|
||||
vs->ireg[thisBlockDeepth] = !pika_assert;
|
||||
|
||||
|
@ -269,6 +269,7 @@ Arg* arg_setStr(Arg* self, char* name, char* string) {
|
||||
}
|
||||
|
||||
int64_t arg_getInt(Arg* self) {
|
||||
pika_assert(NULL!=self);
|
||||
if (NULL == arg_getContent(self)) {
|
||||
return -999999;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user