From 38e21d3cd9409d583c627fb9bd401db5dcbd6981 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 15 Jan 2026 15:47:38 +0100 Subject: feat: implemented `->`, `.`, error handling. Signed-off-by: Amlal El Mahrouss --- include/CompilerKit/AST.h | 2 +- include/CompilerKit/Utilities/Compiler.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'include/CompilerKit') diff --git a/include/CompilerKit/AST.h b/include/CompilerKit/AST.h index f45d6fd..0ee8f9e 100644 --- a/include/CompilerKit/AST.h +++ b/include/CompilerKit/AST.h @@ -38,13 +38,13 @@ enum struct KeywordKind { kKeywordKindNew, kKeywordKindDelete, kKeywordKindAccess, + kKeywordKindAccessChecked, kKeywordKindIf, kKeywordKindElse, kKeywordKindElseIf, kKeywordKindVariableAssign, kKeywordKindVariableDec, kKeywordKindVariableInc, - kKeywordKindConstant, kKeywordKindTypedef, kKeywordKindEndLine, // Optional in Nectar. kKeywordKindSpecifier, diff --git a/include/CompilerKit/Utilities/Compiler.h b/include/CompilerKit/Utilities/Compiler.h index 2efd7a4..6777ca5 100644 --- a/include/CompilerKit/Utilities/Compiler.h +++ b/include/CompilerKit/Utilities/Compiler.h @@ -32,7 +32,7 @@ #define kPrintF kStdOut #define kPrintErr kStdErr -inline static UInt32 kErrorLimit = 10; +inline static UInt32 kErrorLimit = 0; inline static UInt32 kAcceptableErrors = 0; inline static bool kVerbose = false; inline static bool kOutputAsBinary = false; @@ -51,9 +51,8 @@ inline void print_error(STLString reason, STLString file) noexcept { kStdErr << reason << kBlank << std::endl; - if (kAcceptableErrors > kErrorLimit) std::exit(NECTAR_EXEC_ERROR); - ++kAcceptableErrors; + if (kAcceptableErrors > kErrorLimit) std::exit(NECTAR_EXEC_ERROR); } inline void print_warning(STLString reason, STLString file) noexcept { -- cgit v1.2.3