#pragma once #include #include #include #include #include // for clangd namespace interpreter { class Node; } // namespace interpreter namespace info { using NumberValue = long long; using FloatNumberValue = float; using StringValue = std::string; struct SimpleValue { std::variant value; }; struct Value { enum class ValueStructure { Simple, // one value Variant, // one value from list, can have arguments // MultiVariant, // constructed variant // ?? Tuple, // tuple of values }; ValueStructure structure; std::vector> values; }; // better variant value storage (then string) ?? struct Info { std::string name; }; struct VariantTypeInfo; struct TupleTypeInfo; struct AliasTypeInfo; enum class BuiltInTypeInfo { StringT, IntT, FloatT, }; using TypeInfo = std::variant; struct VariableInfo : public Info { Value value; TypeInfo* type = nullptr; }; // TODO lambda functions as values // TODO aliases ?? struct TupleTypeInfo : public Info { std::vector, TypeInfo>> fields; }; struct VariantTypeInfo : public Info { std::vector> constructors; // ?? any type instead of tuple type ?? }; struct AliasTypeInfo : public Info { bool isAnotherType; // = true by default ?? TypeInfo* type = nullptr; }; struct TypeclassInfo : public Info { // TODO }; struct PointerInfo { VariableInfo* variable; }; struct FunctionInfo : public Info { interpreter::Node* definition; std::vector args; // add requirements ?? }; struct NamespaceInfo : public Info { std::unordered_map types; std::unordered_map variables; std::unordered_map functions; std::unordered_map namespaces; }; } // namespace info