function type

This commit is contained in:
ProgramSnail 2023-08-14 18:14:05 +03:00
parent 7f3dfd71a1
commit fa01d36a84
10 changed files with 87 additions and 64 deletions

View file

@ -54,6 +54,7 @@ enum class Type {
VARIANT_TYPE,
TUPLE_TYPE,
FUNCTION_TYPE,
ARRAY_TYPE,
REFERENCE_TYPE,
MODIFIED_TYPE,
@ -149,6 +150,7 @@ const static std::string LAMBDA = "lambda";
const static std::string VARIANT_TYPE = "variant_type";
const static std::string TUPLE_TYPE = "tuple_type";
const static std::string FUNCTION_TYPE = "function_type";
const static std::string ARRAY_TYPE = "array_type";
const static std::string REFERENCE_TYPE = "reference_type";
const static std::string MODIFIED_TYPE = "modified_type";
@ -242,6 +244,8 @@ inline Type string_to_type(const std::string &str) {
return Type::VARIANT_TYPE;
} else if (str == TUPLE_TYPE) {
return Type::TUPLE_TYPE;
} else if (str == FUNCTION_TYPE) {
return Type::FUNCTION_TYPE;
} else if (str == ARRAY_TYPE) {
return Type::ARRAY_TYPE;
} else if (str == REFERENCE_TYPE) {