diff --git a/src/headers/parsing/ParseComponents.hpp b/src/headers/parsing/ParseComponents.hpp index 8e1bdb3..6ed1f10 100644 --- a/src/headers/parsing/ParseComponents.hpp +++ b/src/headers/parsing/ParseComponents.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include using namespace std; #include "../lex.hpp" @@ -60,15 +60,15 @@ public: inline const_iterator cend() const noexcept { return subComponents.cend(); } IS_PARSECOMPONENT auto findById() const { - return subComponents | views::filter([](unique_ptr& it) { + return subComponents | filter([](unique_ptr& it) -> bool { return it->getId() == typeid(T); - }) | views::transform([](unique_ptr& it) { + }) | transform([](unique_ptr& it) { return reinterpret_cast(it.get()); }); } IS(StandardComponents::NamedIdentifier) optional> findReferenceByName(const string& name) const { - auto identifiers = findById() | views::transform([](T* it) { + auto identifiers = findById() | transform([](T* it) { return ref(static_cast(*it)); }); for (const auto& identifier: identifiers) { diff --git a/src/headers/transpiler/Target.hpp b/src/headers/transpiler/Target.hpp index ce8fb59..867cd4e 100644 --- a/src/headers/transpiler/Target.hpp +++ b/src/headers/transpiler/Target.hpp @@ -81,6 +81,7 @@ public: #undef with const bool newLines; explicit Target(const bool newLines): newLines(newLines) {}; + virtual ~Target() = default; }; #undef INCLUDECOMPONENT diff --git a/src/main.cpp b/src/main.cpp index befce84..afdc3e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,7 +30,7 @@ int main(int argc, char* argv[]) { else if (currentArg == Argument("newlinesoff")) newLines = false; else if (currentArg.ends_with(".ybcon")) files.push_back(currentArg); } - const auto compile = [&target, &newLines](string_view name) { + const auto compile = [&target, &newLines](string_view name) -> string { string transpiledString = transpile(parseString(getFileContent(name.data())), target, newLines); name.remove_suffix(6); string outputFile;