mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2026-01-25 21:17:11 +00:00
function type
This commit is contained in:
parent
7f3dfd71a1
commit
fa01d36a84
10 changed files with 87 additions and 64 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue