Skip to content
Snippets Groups Projects
Commit 9be17d01 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add simple CompoundDataVariant type

parent 9aeb813b
No related branches found
No related tags found
1 merge request!37Feature/language
...@@ -92,6 +92,10 @@ ASTNodeAffectationExpressionBuilder::ASTNodeAffectationExpressionBuilder(ASTNode ...@@ -92,6 +92,10 @@ ASTNodeAffectationExpressionBuilder::ASTNodeAffectationExpressionBuilder(ASTNode
set_affectation_processor_for_string_data(data_type); set_affectation_processor_for_string_data(data_type);
break; break;
} }
case ASTNodeDataType::typename_t: {
throw parse_error("unexpected error: compound type affectation NIY", std::vector{n.begin()});
break;
}
default: { default: {
throw parse_error("unexpected error: undefined value type for affectation", std::vector{n.begin()}); throw parse_error("unexpected error: undefined value type for affectation", std::vector{n.begin()});
} }
......
#ifndef AST_NODE_DATA_VARIANT_HPP #ifndef AST_NODE_DATA_VARIANT_HPP
#define AST_NODE_DATA_VARIANT_HPP #define AST_NODE_DATA_VARIANT_HPP
#include <memory>
#include <variant> #include <variant>
using ASTNodeDataVariant = std::variant<std::monostate, bool, uint64_t, int64_t, double, std::string>; struct CompoundDataVariant;
using ASTNodeDataVariant =
std::variant<std::monostate, bool, uint64_t, int64_t, double, std::string, CompoundDataVariant>;
struct CompoundDataVariant
{
std::vector<ASTNodeDataVariant> m_data_vector;
friend std::ostream&
operator<<(std::ostream& os, const CompoundDataVariant&)
{
os << " *CompoundDataVariant* ";
return os;
}
};
#endif // AST_NODE_DATA_VARIANT_HPP #endif // AST_NODE_DATA_VARIANT_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment