Fix the "No valid file provided." sentence that was not being printed.

This commit is contained in:
Username404-59 2021-06-11 13:24:41 +02:00
parent bbc980c6a9
commit 78cf850533
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 15 additions and 10 deletions

View File

@ -21,17 +21,22 @@ int main(int argc, char* argv[]) {
}
else if (currentArg.ends_with(".ybcon")) files.push_back(currentArg);
}
const set<string_view> uniqueFiles(files.begin(), files.end());
for (string_view fileName: uniqueFiles) {
if (fileName != "none") {
const string transpiledString = transpile(parseString(getFileContent(fileName.data())), target);
if (printResult) cout << "~~~~[Yerbacon compilation result]~~~~\n\n" << "[WIP]\n" << transpiledString << "\n\n";
fileName.remove_suffix(6);
string outputFile;
(outputFile = fileName).append(target);
outputFileContent(outputFile, transpiledString);
if (!files.empty()) {
const set<string_view> uniqueFiles(files.begin(), files.end());
for (string_view fileName: uniqueFiles) {
if (fileName != "none") {
const string transpiledString = transpile(parseString(getFileContent(fileName.data())), target);
if (printResult) cout << "~~~~[Yerbacon compilation result]~~~~\n\n" << "[WIP]\n" << transpiledString << "\n\n";
fileName.remove_suffix(6);
string outputFile;
(outputFile = fileName).append(target);
outputFileContent(outputFile, transpiledString);
}
}
} else {
cout << "No valid file provided.\n"; goto exitPoint;
}
} else cout << "No valid file provided.\n";
}
exitPoint:
return EXIT_SUCCESS;
}