Re-add a variable to hold the current target in main.cpp, and capture it by value in the compile function

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-03-16 13:51:36 +01:00
parent 1f819bc136
commit 513c9a44a0
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 2 deletions

View File

@ -46,8 +46,9 @@ int main(int argc, char* argv[]) {
} else invalid_argument: Yerbacon::fail({"\"", currentArg.data(), "\" is not a valid argument."});
}
}
const auto compile = [&target, &newLines](string_view name) -> string {
string transpiledString = Target::forName(target, newLines)->transpileWithTree(parseString(getFileContent(name.data())));
const auto current_target = Target::forName(target, newLines);
const auto compile = [&target, current_target](string_view name) -> string {
string transpiledString = current_target->transpileWithTree(parseString(getFileContent(name.data())));
name.remove_suffix(6);
string outputFile;
(outputFile = name).append(target);