MCPcopy Create free account
hub / github.com/SaptakBhoumik/Peregrine / searchDefaultModule

Method searchDefaultModule

Peregrine/codegen/cpp/codegen.cpp:77–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77std::string Codegen::searchDefaultModule(std::string path,
78 std::string moduleName) {
79 for (auto& entry : std::filesystem::directory_iterator(path)) {
80 if (std::filesystem::path(entry.path()).filename() == moduleName) {
81 // TODO:ignore extensions?
82 if (entry.is_regular_file()) {
83 return entry.path().string();
84 } else if (entry.is_directory()) {
85 // TODO: avoid deeply nested folders
86 searchDefaultModule(entry.path().string(), moduleName);
87 }
88 }
89 }
90
91 return "";
92}
93
94void Codegen::codegenFuncParams(std::vector<ast::parameter> parameters,size_t start) {
95 if ((parameters.size()-start)>0) {

Callers

nothing calls this directly

Calls 1

stringMethod · 0.80

Tested by

no test coverage detected