mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
execute_visitor value types fixed
This commit is contained in:
parent
9aaac90ef6
commit
6bf64acc4d
5 changed files with 146 additions and 128 deletions
|
|
@ -34,7 +34,7 @@ public:
|
|||
bool Same(const InternalValue& value) const;
|
||||
std::optional<utils::IdType> GetFieldValue(const std::string& name) const;
|
||||
|
||||
utils::IdType DeepCopy(ValueManager* value_manager);
|
||||
utils::IdType DeepCopy(ValueManager* value_manager, utils::ValueType new_value_type);
|
||||
|
||||
public:
|
||||
std::variant<double,
|
||||
|
|
@ -45,7 +45,7 @@ public:
|
|||
Unit> value;
|
||||
};
|
||||
|
||||
struct TupleValue { /// TODO: no need to store strings (only store associated type) ??
|
||||
struct TupleValue { /// no need to store strings (only store associated type) ??
|
||||
public:
|
||||
TupleValue() = default;
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public:
|
|||
bool Same(const TupleValue& other_value) const;
|
||||
std::optional<utils::IdType> GetFieldValue(const std::string& name) const;
|
||||
|
||||
utils::IdType DeepCopy(ValueManager* value_manager); // TODO
|
||||
utils::IdType DeepCopy(ValueManager* value_manager, utils::ValueType new_value_type); // TODO
|
||||
|
||||
public:
|
||||
std::vector<std::pair<std::optional<std::string>, utils::IdType>> fields;
|
||||
|
|
@ -75,7 +75,7 @@ public:
|
|||
bool Same(const VariantValue& other_value) const;
|
||||
std::optional<utils::IdType> GetFieldValue(const std::string& name) const;
|
||||
|
||||
utils::IdType DeepCopy(ValueManager* value_manager);
|
||||
utils::IdType DeepCopy(ValueManager* value_manager, utils::ValueType new_value_type);
|
||||
|
||||
public:
|
||||
TupleValue value;
|
||||
|
|
@ -94,7 +94,7 @@ public:
|
|||
bool Same(const ReferenceToValue& other_value) const;
|
||||
std::optional<utils::IdType> GetFieldValue(const std::string& name) const;
|
||||
|
||||
utils::IdType DeepCopy(ValueManager* value_manager);
|
||||
utils::IdType DeepCopy(ValueManager* value_manager, utils::ValueType new_value_type);
|
||||
|
||||
public:
|
||||
std::vector<utils::ReferenceModifier> references;
|
||||
|
|
@ -115,7 +115,7 @@ public:
|
|||
bool Same(const FunctionValue& other_value) const;
|
||||
std::optional<utils::IdType> GetFieldValue(const std::string& name) const;
|
||||
|
||||
utils::IdType DeepCopy(ValueManager* value_manager);
|
||||
utils::IdType DeepCopy(ValueManager* value_manager, utils::ValueType new_value_type);
|
||||
|
||||
public:
|
||||
std::variant<interpreter::tokens::FunctionDeclaration*,
|
||||
|
|
@ -138,7 +138,7 @@ public:
|
|||
bool Same(const ArrayValue& other_value) const;
|
||||
std::optional<utils::IdType> GetFieldValue(const std::string& name) const;
|
||||
|
||||
utils::IdType DeepCopy(ValueManager* value_manager);
|
||||
utils::IdType DeepCopy(ValueManager* value_manager, utils::ValueType new_value_type);
|
||||
|
||||
public:
|
||||
std::vector<utils::IdType> elements;
|
||||
|
|
@ -158,7 +158,7 @@ public:
|
|||
bool Same(const OptionalValue& other_value) const;
|
||||
std::optional<utils::IdType> GetFieldValue(const std::string& name) const;
|
||||
|
||||
utils::IdType DeepCopy(ValueManager* value_manager);
|
||||
utils::IdType DeepCopy(ValueManager* value_manager, utils::ValueType new_value_type);
|
||||
|
||||
public:
|
||||
std::optional<utils::IdType> value;
|
||||
|
|
@ -177,7 +177,7 @@ public:
|
|||
bool Same(const Value& other_value) const;
|
||||
std::optional<utils::IdType> GetFieldValue(const std::string& name) const;
|
||||
|
||||
utils::IdType DeepCopy(ValueManager* value_manager);
|
||||
utils::IdType DeepCopy(ValueManager* value_manager, utils::ValueType new_value_type);
|
||||
|
||||
public:
|
||||
std::variant<InternalValue,
|
||||
|
|
@ -223,7 +223,7 @@ public:
|
|||
return &values_.at(value_id).first;
|
||||
}
|
||||
|
||||
utils::ValueType GetValueType(utils::IdType value_id) {
|
||||
utils::ValueType& GetValueType(utils::IdType value_id) {
|
||||
return values_.at(value_id).second;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue