Skip to content

Commit

Permalink
ShitGen 최신 버전으로 업데이트
Browse files Browse the repository at this point in the history
  • Loading branch information
kmc7468 committed Aug 17, 2023
1 parent 22db092 commit f828881
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ShitGen
12 changes: 6 additions & 6 deletions src/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,7 @@ namespace sam {
return std::nullopt;
}

if (dot == 0) {
return Name{ name, "", name };
} else if (dot == 1) {
if (dot == 1) {
const std::size_t lastDot = name.find_last_of('.');
if (lastDot == std::string::npos) {
return Name{ "", name, name };
Expand All @@ -444,6 +442,8 @@ namespace sam {
} else {
return Name{ name.substr(0, prevLastDot), name.substr(prevLastDot + 1), name };
}
} else {
return Name{ name, "", name };
}
}
bool Parser::ParseExternModule(const Name& namespaceName, const std::string& path) {
Expand All @@ -459,9 +459,9 @@ namespace sam {
realPath.erase(realPath.begin());
} else {
for (const char* directory : m_ImportDirectories) {
const auto path = std::filesystem::path(directory) / resolvedPath.substr(1);
if (std::filesystem::exists(path)) {
realPath = std::filesystem::weakly_canonical(path).generic_string();
const auto tempPath = std::filesystem::path(directory) / resolvedPath.substr(1);
if (std::filesystem::exists(tempPath)) {
realPath = std::filesystem::weakly_canonical(tempPath).generic_string();
goto parse;
}
}
Expand Down

0 comments on commit f828881

Please sign in to comment.