mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
print ins of all line
This commit is contained in:
parent
549cbe1ba3
commit
f6da565249
1
port/linux/.vscode/launch.json
vendored
1
port/linux/.vscode/launch.json
vendored
@ -18,6 +18,7 @@
|
||||
"program": "${workspaceFolder}/build/test/pikascript_test",
|
||||
// "program": "${workspaceFolder}/../build/src/boot/demo06-pikamain/pikascript_demo06-pikamain",
|
||||
"args": [
|
||||
// "--gtest_filter=pikaMain.range",
|
||||
// "--gtest_filter=parser.class_def_void_line",
|
||||
// "--gtest_filter=VM.WHILE_byte",
|
||||
// "--gtest_filter=pikaMain.task_run_once",
|
||||
|
@ -30,7 +30,7 @@ TEST(sysObj, noMethod) {
|
||||
// int errCode = args_getErrorCode(globals->list);
|
||||
// printf("sysout = %s\r\n", sysOut);
|
||||
// ASSERT_EQ(1, strEqu((char*)"[error] runner: method no found.", sysOut));
|
||||
EXPECT_STREQ(log_buff[2], "[error] runner: method no found.\r\n");
|
||||
EXPECT_STREQ(log_buff[4], "[error] runner: method no found.\r\n");
|
||||
// ASSERT_EQ(2, errCode);
|
||||
// obj_deinit(globals);
|
||||
obj_deinit(obj);
|
||||
|
17
src/PikaVM.c
17
src/PikaVM.c
@ -1162,8 +1162,23 @@ VMParameters* pikaVM_runByteCodeWithState(PikaObj* self,
|
||||
vs.pc = pikaVM_runInstructUnit(self, &vs, this_ins_unit);
|
||||
if (0 != vs.error_code) {
|
||||
__platform_printf("[info] input commond: \r\n");
|
||||
instructUnit_printWithConst(this_ins_unit,
|
||||
InstructUnit* head_ins_unit = this_ins_unit;
|
||||
/* get first ins of a line */
|
||||
while (1) {
|
||||
if (instructUnit_getIsNewLine(head_ins_unit)) {
|
||||
break;
|
||||
}
|
||||
head_ins_unit--;
|
||||
}
|
||||
/* print inses of a line */
|
||||
while (1) {
|
||||
instructUnit_printWithConst(head_ins_unit,
|
||||
&(bytecode_frame->const_pool));
|
||||
head_ins_unit++;
|
||||
if (head_ins_unit > this_ins_unit) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
__platform_error_handle();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user