summaryrefslogtreecommitdiffhomepage
path: root/src/CompilerKit
diff options
context:
space:
mode:
Diffstat (limited to 'src/CompilerKit')
-rw-r--r--src/CompilerKit/src/Frontends/NectarCompiler+AMD64.cpp6
-rw-r--r--src/CompilerKit/src/Frontends/NectarCompiler+Chk.cpp4
-rw-r--r--src/CompilerKit/src/Frontends/NectarCompiler+PTX.cpp6
3 files changed, 7 insertions, 9 deletions
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<std::pair<CompilerKit::STLString, CompilerKit::STLString>> 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<std::pair<CompilerKit::STLString, CompilerKit::STLString>> 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);