From 3e6fcda61e87f61fba547bed1eb239981966cb68 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 24 Mar 2026 15:02:01 +0100 Subject: [FEAT] New keywords and checker additions, moving proofs in the papers module. Signed-off-by: Amlal El Mahrouss --- src/CompilerKit/src/Frontends/NectarCompiler+AMD64.cpp | 6 ++---- src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp | 4 +++- src/CompilerKit/src/Frontends/NectarCompiler+PTX.cpp | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/CompilerKit/src/Frontends/NectarCompiler+AMD64.cpp b/src/CompilerKit/src/Frontends/NectarCompiler+AMD64.cpp index baf7e2f..97b5161 100644 --- a/src/CompilerKit/src/Frontends/NectarCompiler+AMD64.cpp +++ b/src/CompilerKit/src/Frontends/NectarCompiler+AMD64.cpp @@ -348,10 +348,7 @@ CompilerKit::SyntaxLeafList::SyntaxLeaf CompilerFrontendNectarAMD64::Compile( } std::vector> operators = { - {"=:", "jne"}, - {"!=:", "je"}, - {">:", "jl"}, - {"<:", "jg"}, + {"!==", "ne"}, {"===", "eq"}, {">", "jl"}, {"<", "jg"}, {">=", "jle"}, {"<=", "jge"}, }; for (auto& op : operators) { @@ -1650,6 +1647,7 @@ NECTAR_MODULE(CompilerNectarAMD64) { kKeywords.emplace_back("(", CompilerKit::KeywordKind::kKeywordKindFunctionStart); kKeywords.emplace_back(")", CompilerKit::KeywordKind::kKeywordKindFunctionEnd); kKeywords.emplace_back(":=", CompilerKit::KeywordKind::kKeywordKindVariableAssign); + kKeywords.emplace_back(":==", CompilerKit::KeywordKind::kKeywordKindVariableEquals); kKeywords.emplace_back("+=", CompilerKit::KeywordKind::kKeywordKindVariableInc); kKeywords.emplace_back("-=", CompilerKit::KeywordKind::kKeywordKindVariableDec); kKeywords.emplace_back("const", CompilerKit::KeywordKind::kKeywordKindVariable); diff --git a/src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp b/src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp index c636f3a..c3faf49 100644 --- a/src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp +++ b/src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp @@ -58,7 +58,9 @@ CK_IMPORT_C bool NectarCheckLine(CompilerKit::STLString& input) { if (input.find("(") != CompilerKit::STLString::npos && input.find("const") == CompilerKit::STLString::npos && - input.find("let") == CompilerKit::STLString::npos) { + input.find("let") == CompilerKit::STLString::npos && + input.find("if") == CompilerKit::STLString::npos && + input.find("else") == CompilerKit::STLString::npos) { if (input.find(";") == CompilerKit::STLString::npos) { Detail::print_error("A function call must always end with ';'", "check"); return false; diff --git a/src/CompilerKit/src/Frontends/NectarCompiler+PTX.cpp b/src/CompilerKit/src/Frontends/NectarCompiler+PTX.cpp index 8b2b3bb..4583dfe 100644 --- a/src/CompilerKit/src/Frontends/NectarCompiler+PTX.cpp +++ b/src/CompilerKit/src/Frontends/NectarCompiler+PTX.cpp @@ -355,10 +355,7 @@ CompilerKit::SyntaxLeafList::SyntaxLeaf CompilerFrontendNectarPTX::Compile( } std::vector> operators = { - {"=:", "ne"}, - {"!=:", "eq"}, - {">:", "lt"}, - {"<:", "gt"}, + {"!==", "ne"}, {"===", "eq"}, {">", "lt"}, {"<", "gt"}, {">=", "lte"}, {"<=", "gte"}, }; for (auto& op : operators) { @@ -1594,6 +1591,7 @@ NECTAR_MODULE(CompilerNectarPTX) { kKeywords.emplace_back("->", CompilerKit::KeywordKind::kKeywordKindAccessChecked); kKeywords.emplace_back("(", CompilerKit::KeywordKind::kKeywordKindFunctionAccess); kKeywords.emplace_back(";", CompilerKit::KeywordKind::kKeywordKindEndLine); + kKeywords.emplace_back(":==", CompilerKit::KeywordKind::kKeywordKindVariableEquals); kKeywords.emplace_back("return", CompilerKit::KeywordKind::kKeywordKindReturn); kKeywords.emplace_back("extern", CompilerKit::KeywordKind::kKeywordKindExtern); kKeywords.emplace_back("import", CompilerKit::KeywordKind::kKeywordKindImport); -- cgit v1.2.3