mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-06 06:58:46 +00:00
39 lines
740 B
C++
39 lines
740 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "basic_nodes.hpp"
|
|
|
|
namespace builtin {
|
|
|
|
const static std::string TUPLE_IDENTIFIER = "Tuple";
|
|
|
|
const static std::string VARIANT_IDENTIFIER = "Variant";
|
|
|
|
const static std::string ARRAY_IDENTIFIER = "Array";
|
|
|
|
const static std::string OPTIONAL_IDENTIFIER = "Optional";
|
|
|
|
const static std::string RESULT_IDENTIFIER = "Result";
|
|
|
|
enum class BuiltinType {
|
|
TUPLE,
|
|
VARIANT,
|
|
ARRAY,
|
|
OPTIONAL,
|
|
RESULT,
|
|
NONE,
|
|
};
|
|
|
|
inline nodes::Modifier builtin_to_modifier(BuiltinType type) {
|
|
switch (type) {
|
|
case BuiltinType::OPTIONAL:
|
|
return nodes::Modifier::OPTIONAL;
|
|
case BuiltinType::RESULT:
|
|
return nodes::Modifier::RESULT;
|
|
default:
|
|
return nodes::Modifier::NONE;
|
|
}
|
|
}
|
|
|
|
} // namespace builtin
|