Address listed flaws in implementation

This commit is contained in:
2019-08-06 14:24:26 -07:00
parent 9a89f075b2
commit 329d547f56
3 changed files with 44 additions and 2 deletions

View File

@@ -24,6 +24,16 @@ struct branch {
using branch_ptr = std::unique_ptr<branch>;
struct constructor {
std::string name;
std::vector<std::string> types;
constructor(std::string n, std::vector<std::string> ts)
: name(std::move(n)), types(std::move(ts)) {}
};
using constructor_ptr = std::unique_ptr<constructor>;
struct definition {
virtual ~definition() = default;
};
@@ -108,3 +118,11 @@ struct definition_defn : public definition {
}
};
struct definition_data : public definition {
std::string name;
std::vector<constructor_ptr> constructors;
definition_data(std::string n, std::vector<constructor_ptr> cs)
: name(std::move(n)), constructors(std::move(cs)) {}
};