add Bx for default RET ins

This commit is contained in:
lyon 2022-01-24 00:19:09 +08:00
parent 1c1692e759
commit 6d0a43aa80
16 changed files with 5 additions and 0 deletions

0
port/linux/api-make-linux.sh Normal file → Executable file
View File

0
port/linux/api-make-win10.sh Normal file → Executable file
View File

0
port/linux/api-make.sh Normal file → Executable file
View File

0
port/linux/ci_benchmark.sh Normal file → Executable file
View File

0
port/linux/gtest.sh Normal file → Executable file
View File

0
port/linux/init.sh Normal file → Executable file
View File

0
port/linux/install_dependency.sh Normal file → Executable file
View File

0
port/linux/make.sh Normal file → Executable file
View File

0
port/linux/pkg-push.sh Normal file → Executable file
View File

0
port/linux/pull-core.sh Normal file → Executable file
View File

0
port/linux/push-core.sh Normal file → Executable file
View File

0
port/linux/run.sh Normal file → Executable file
View File

0
port/linux/test-banchmark.sh Normal file → Executable file
View File

View File

@ -723,6 +723,7 @@ TEST(parser, def_add) {
"1 REF a\n"
"1 REF b\n"
"0 OPT +\n"
"B1\n"
"0 RET\n"
"B0\n"
);
@ -750,6 +751,7 @@ TEST(parser, def_add_return) {
"1 REF b\n"
"0 OPT +\n"
"0 RET\n"
"B1\n"
"0 RET\n"
"B0\n"
);
@ -783,6 +785,7 @@ TEST(parser, def_while_return) {
"0 RET\n"
"B1\n"
"0 JMP -1\n"
"B1\n"
"0 RET\n"
"B0\n"
);
@ -813,6 +816,7 @@ TEST(parser, def_while_return_void) {
"0 RET\n"
"B1\n"
"0 JMP -1\n"
"B1\n"
"0 RET\n"
"B0\n"
);

0
port/linux/update-compiler.sh Normal file → Executable file
View File

View File

@ -1159,6 +1159,7 @@ char* AST_toPikaAsm(AST* ast, Args* buffs) {
}
/* return when exit method */
if (strEqu(blockType, "def")) {
pikaAsm = ASM_addBlockDeepth(ast, buffs, pikaAsm, 1);
pikaAsm = strsAppend(buffs, pikaAsm, (char*)"0 RET\n");
}
}