Attach a dummy __doc__ for -c option so strings don't throw syntax error

This commit is contained in:
K. Lange 2021-03-08 11:08:33 +09:00
parent e6ef1ea1e4
commit 9229bc0899

View File

@ -566,6 +566,7 @@ static int runString(char * argv[], int flags, char * string) {
findInterpreter(argv); findInterpreter(argv);
krk_initVM(flags); krk_initVM(flags);
krk_startModule("__main__"); krk_startModule("__main__");
krk_attachNamedValue(&krk_currentThread.module->fields,"__doc__", NONE_VAL());
krk_interpret(string, "<stdin>"); krk_interpret(string, "<stdin>");
krk_freeVM(); krk_freeVM();
return 0; return 0;