This commit is contained in:
blueloveTH 2023-03-29 10:59:16 +08:00
parent 8764a23302
commit 86a290e6c4
2 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,7 @@ with open("src/opcodes.h", "rt", encoding='utf-8') as f:
pipeline = [ pipeline = [
["common.h", "memory.h", "str.h", "tuplelist.h", "namedict.h", "error.h"], ["common.h", "memory.h", "str.h", "tuplelist.h", "namedict.h", "error.h"],
["obj.h", "parser.h", "codeobject.h", "frame.h"], ["obj.h", "parser.h", "codeobject.h", "frame.h"],
["vm.h", "ref.h", "ceval.h", "compiler.h", "repl.h"], ["gc.h", "vm.h", "ref.h", "ceval.h", "compiler.h", "repl.h"],
["iter.h", "cffi.h", "io.h", "_generated.h", "pocketpy.h"] ["iter.h", "cffi.h", "io.h", "_generated.h", "pocketpy.h"]
] ]

View File

@ -69,7 +69,10 @@ int main(int argc, char** argv){
return 1; return 1;
} }
std::ifstream file(filepath); std::ifstream file(filepath);
if(!file.is_open()) return 1; if(!file.is_open()){
std::cerr << "Failed to open file: " << argv_1 << std::endl;
return 1;
}
std::string src((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>()); std::string src((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
// set parent path as cwd // set parent path as cwd