mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
out to self
This commit is contained in:
parent
31f9f10081
commit
500709b5d2
@ -2042,18 +2042,18 @@ TEST(parser, class_) {
|
||||
char* pikaAsm = Parser_multiLineToAsm(buffs, (char*)lines);
|
||||
printf("%s", pikaAsm);
|
||||
EXPECT_STREQ(pikaAsm, (char* )
|
||||
"B0\n"
|
||||
"0 DEF Test()\n"
|
||||
"0 JMP 1\n"
|
||||
"B1\n"
|
||||
"0 RUN PikaStdLib.PikaObj\n"
|
||||
"0 SLF\n"
|
||||
"B1\n"
|
||||
"0 NUM 1\n"
|
||||
"0 OUT x\n"
|
||||
"B1\n"
|
||||
"0 RET\n"
|
||||
"B0\n"
|
||||
"B0\n"
|
||||
"0 DEF Test()\n"
|
||||
"0 JMP 1\n"
|
||||
"B1\n"
|
||||
"0 RUN PikaStdLib.PikaObj\n"
|
||||
"0 OUT self\n"
|
||||
"B1\n"
|
||||
"0 NUM 1\n"
|
||||
"0 OUT x\n"
|
||||
"B1\n"
|
||||
"0 RET self\n"
|
||||
"B0\n"
|
||||
);
|
||||
args_deinit(buffs);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
|
@ -1327,7 +1327,7 @@ char* AST_toPikaASM(AST* ast, Args* outBuffs) {
|
||||
/* return when exit class */
|
||||
if (strEqu(blockType, "class")) {
|
||||
pikaAsm = ASM_addBlockDeepth(ast, outBuffs, pikaAsm, 1);
|
||||
pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 RET\n");
|
||||
pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 RET self\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1449,7 +1449,7 @@ char* AST_toPikaASM(AST* ast, Args* outBuffs) {
|
||||
pikaAsm = strsAppend(buffs, pikaAsm, "0 RUN ");
|
||||
pikaAsm = strsAppend(buffs, pikaAsm, superClass);
|
||||
pikaAsm = strsAppend(buffs, pikaAsm, "\n");
|
||||
pikaAsm = strsAppend(buffs, pikaAsm, "0 SLF\n");
|
||||
pikaAsm = strsAppend(buffs, pikaAsm, "0 OUT self\n");
|
||||
|
||||
is_block_matched = 1;
|
||||
args_deinit(buffs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user