From d659fb977987b834a631ce69f245683ede38f40f Mon Sep 17 00:00:00 2001
From: augustin64 <me.git@augustin64.fr>
Date: Wed, 3 Jan 2024 12:48:00 +0100
Subject: [PATCH] Add ErrorType::NestedFunction

---
 src/errors.cpp       | 1 +
 src/include/errors.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/errors.cpp b/src/errors.cpp
index b1ffbc1..ba55fd2 100644
--- a/src/errors.cpp
+++ b/src/errors.cpp
@@ -24,6 +24,7 @@ string UserError::get_message(void) const {
         case ErrorType::TypeNotCastable: return "Can't find an explicit cast to "+get<string>(this->data)+"'";
         case ErrorType::TypesNotComparable: return "Types not comparable";
         case ErrorType::ExpectedIntegralType: return "Expression must have integral type";
+        case ErrorType::NestedFunction: return "Function definition is not allowed here";
         case ErrorType::ExpectedArithmeticType: return "Expression must have arithmetic type";
         case ErrorType::UnknownIdentifier: return "Unknown identifier '"+get<string>(this->data)+"'";
         case ErrorType::AlreadyDeclaredIdentifier: return "Already declared identifier '"+get<string>(this->data)+"'";
diff --git a/src/include/errors.h b/src/include/errors.h
index df1dd26..4f0f54e 100644
--- a/src/include/errors.h
+++ b/src/include/errors.h
@@ -33,6 +33,7 @@ enum class ErrorType {
     TypesNotComparable,
     ExpectedIntegralType,
     ExpectedArithmeticType,
+    NestedFunction,
 
     // Runtime
     UnknownIdentifier,