Add ErrorType::NestedFunction

This commit is contained in:
augustin64 2024-01-03 12:48:00 +01:00
parent b00f3c222d
commit d659fb9779
2 changed files with 2 additions and 0 deletions

View File

@ -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::TypeNotCastable: return "Can't find an explicit cast to "+get<string>(this->data)+"'";
case ErrorType::TypesNotComparable: return "Types not comparable"; case ErrorType::TypesNotComparable: return "Types not comparable";
case ErrorType::ExpectedIntegralType: return "Expression must have integral type"; 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::ExpectedArithmeticType: return "Expression must have arithmetic type";
case ErrorType::UnknownIdentifier: return "Unknown identifier '"+get<string>(this->data)+"'"; case ErrorType::UnknownIdentifier: return "Unknown identifier '"+get<string>(this->data)+"'";
case ErrorType::AlreadyDeclaredIdentifier: return "Already declared identifier '"+get<string>(this->data)+"'"; case ErrorType::AlreadyDeclaredIdentifier: return "Already declared identifier '"+get<string>(this->data)+"'";

View File

@ -33,6 +33,7 @@ enum class ErrorType {
TypesNotComparable, TypesNotComparable,
ExpectedIntegralType, ExpectedIntegralType,
ExpectedArithmeticType, ExpectedArithmeticType,
NestedFunction,
// Runtime // Runtime
UnknownIdentifier, UnknownIdentifier,