Fix the "No valid file provided." sentence that was not being printed.
This commit is contained in:
parent
bbc980c6a9
commit
78cf850533
25
src/main.cpp
25
src/main.cpp
|
@ -21,17 +21,22 @@ int main(int argc, char* argv[]) {
|
||||||
}
|
}
|
||||||
else if (currentArg.ends_with(".ybcon")) files.push_back(currentArg);
|
else if (currentArg.ends_with(".ybcon")) files.push_back(currentArg);
|
||||||
}
|
}
|
||||||
const set<string_view> uniqueFiles(files.begin(), files.end());
|
if (!files.empty()) {
|
||||||
for (string_view fileName: uniqueFiles) {
|
const set<string_view> uniqueFiles(files.begin(), files.end());
|
||||||
if (fileName != "none") {
|
for (string_view fileName: uniqueFiles) {
|
||||||
const string transpiledString = transpile(parseString(getFileContent(fileName.data())), target);
|
if (fileName != "none") {
|
||||||
if (printResult) cout << "~~~~[Yerbacon compilation result]~~~~\n\n" << "[WIP]\n" << transpiledString << "\n\n";
|
const string transpiledString = transpile(parseString(getFileContent(fileName.data())), target);
|
||||||
fileName.remove_suffix(6);
|
if (printResult) cout << "~~~~[Yerbacon compilation result]~~~~\n\n" << "[WIP]\n" << transpiledString << "\n\n";
|
||||||
string outputFile;
|
fileName.remove_suffix(6);
|
||||||
(outputFile = fileName).append(target);
|
string outputFile;
|
||||||
outputFileContent(outputFile, transpiledString);
|
(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;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue