support FileNoFoundError for runSingleFile

This commit is contained in:
lyon1998 2024-04-03 11:12:01 +08:00
parent ee42c10a7b
commit 908b187493
4 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@
// "--gtest_filter=vm.test_cmodule_import_as"
// "--gtest_filter=vm.subsrc_import"
// "--gtest_filter=event.event_thread"
"--gtest_filter=stddata.pikafs_open"
"--gtest_filter=vm.run_no_file"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",

View File

@ -1762,7 +1762,8 @@ enum shellCTRL _inner_do_obj_runChar(PikaObj* self,
shell->line_position - shell->line_curpos);
shell->lineBuff[shell->line_position + 1] = 0;
if (shell->line_curpos != shell->line_position) {
pika_platform_printf("%s", shell->lineBuff + shell->line_curpos + 1);
pika_platform_printf("%s",
shell->lineBuff + shell->line_curpos + 1);
_putc_cmd(PIKA_KEY_LEFT,
shell->line_position - shell->line_curpos);
}

View File

@ -4021,9 +4021,8 @@ VMParameters* pikaVM_runByteCodeFile(PikaObj* self, char* filename) {
VMParameters* pikaVM_runSingleFile(PikaObj* self, char* filename) {
Args buffs = {0};
Arg* file_arg = arg_loadFile(NULL, filename);
pika_assert(NULL != file_arg);
if (NULL == file_arg) {
pika_platform_printf("Error: can not open file '%s'\n", filename);
pika_platform_printf("FileNotFoundError: %s\n", filename);
return NULL;
}
char* lines = (char*)arg_getBytes(file_arg);

View File

@ -2,4 +2,4 @@
#define PIKA_VERSION_MINOR 13
#define PIKA_VERSION_MICRO 3
#define PIKA_EDIT_TIME "2024/03/11 09:01:07"
#define PIKA_EDIT_TIME "2024/04/03 11:11:49"