Skip to content

Commit 908b187

Browse files
committed
support FileNoFoundError for runSingleFile
1 parent ee42c10 commit 908b187

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

port/linux/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// "--gtest_filter=vm.test_cmodule_import_as"
2525
// "--gtest_filter=vm.subsrc_import"
2626
// "--gtest_filter=event.event_thread"
27-
"--gtest_filter=stddata.pikafs_open"
27+
"--gtest_filter=vm.run_no_file"
2828
],
2929
"stopAtEntry": false,
3030
"cwd": "${workspaceFolder}",

src/PikaObj.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,7 +1762,8 @@ enum shellCTRL _inner_do_obj_runChar(PikaObj* self,
17621762
shell->line_position - shell->line_curpos);
17631763
shell->lineBuff[shell->line_position + 1] = 0;
17641764
if (shell->line_curpos != shell->line_position) {
1765-
pika_platform_printf("%s", shell->lineBuff + shell->line_curpos + 1);
1765+
pika_platform_printf("%s",
1766+
shell->lineBuff + shell->line_curpos + 1);
17661767
_putc_cmd(PIKA_KEY_LEFT,
17671768
shell->line_position - shell->line_curpos);
17681769
}

src/PikaVM.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4021,9 +4021,8 @@ VMParameters* pikaVM_runByteCodeFile(PikaObj* self, char* filename) {
40214021
VMParameters* pikaVM_runSingleFile(PikaObj* self, char* filename) {
40224022
Args buffs = {0};
40234023
Arg* file_arg = arg_loadFile(NULL, filename);
4024-
pika_assert(NULL != file_arg);
40254024
if (NULL == file_arg) {
4026-
pika_platform_printf("Error: can not open file '%s'\n", filename);
4025+
pika_platform_printf("FileNotFoundError: %s\n", filename);
40274026
return NULL;
40284027
}
40294028
char* lines = (char*)arg_getBytes(file_arg);

src/PikaVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#define PIKA_VERSION_MINOR 13
33
#define PIKA_VERSION_MICRO 3
44

5-
#define PIKA_EDIT_TIME "2024/03/11 09:01:07"
5+
#define PIKA_EDIT_TIME "2024/04/03 11:11:49"

0 commit comments

Comments
 (0)