diff options
Diffstat (limited to 'src/CompilerKit')
| -rw-r--r-- | src/CompilerKit/src/CodeGenerator+AssemblyFactory.cpp | 2 | ||||
| -rw-r--r-- | src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/CompilerKit/src/CodeGenerator+AssemblyFactory.cpp b/src/CompilerKit/src/CodeGenerator+AssemblyFactory.cpp index 04ed2be..e758fdc 100644 --- a/src/CompilerKit/src/CodeGenerator+AssemblyFactory.cpp +++ b/src/CompilerKit/src/CodeGenerator+AssemblyFactory.cpp @@ -34,7 +34,9 @@ Int32 AssemblyFactory::Compile(STLString sourceFile, const Int32& arch) { std::filesystem::remove(compiledUnit); return ret; } catch (...) { + auto ret = this->fMounted->CompileToFormat(compiledUnit, arch); std::filesystem::remove(compiledUnit); + return ret; } return NECTAR_UNIMPLEMENTED; diff --git a/src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp b/src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp index cc30592..5c51309 100644 --- a/src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp +++ b/src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp @@ -55,16 +55,16 @@ CK_IMPORT_C bool NectarCheckFrontend(CompilerKit::STLString& input) { } } - if (input.starts_with("let ") && !input.ends_with(";")) { - if (input.find(":=") != CompilerKit::STLString::npos) { - Detail::print_error("A declaration must always end with ';'", "check"); + if (input.find("let ") != CompilerKit::STLString::npos && input.ends_with(";")) { + if (input.find(":=") == CompilerKit::STLString::npos) { + Detail::print_error("A declaration must always include with ':='", "check"); return false; } } - if (input.starts_with("const ") && !input.ends_with(";")) { - if (input.find(":=") != CompilerKit::STLString::npos) { - Detail::print_error("A declaration must always end with ';'", "check"); + if (input.find("const ") != CompilerKit::STLString::npos && input.ends_with(";")) { + if (input.find(":=") == CompilerKit::STLString::npos) { + Detail::print_error("A declaration must always end with ':='", "check"); return false; } } |
