AST building #2
@ -52,6 +52,7 @@ namespace ppc::data {
|
||||
bool_t boolean() const;
|
||||
|
||||
value_t &operator=(const value_t &other);
|
||||
value_t &operator=(const char *other);
|
||||
|
||||
~value_t();
|
||||
value_t();
|
||||
@ -60,6 +61,7 @@ namespace ppc::data {
|
||||
value_t(std::initializer_list<std::pair<std::string, value_t>> map);
|
||||
value_t(number_t val);
|
||||
value_t(const string_t &val);
|
||||
value_t(const char *val);
|
||||
value_t(bool_t val);
|
||||
value_t(const value_t &other);
|
||||
|
||||
|
@ -92,6 +92,10 @@ namespace ppc::data {
|
||||
this->type = type_t::Str;
|
||||
this->val.str = new string_t(val);
|
||||
}
|
||||
value_t::value_t(const char *val) {
|
||||
this->type = type_t::Str;
|
||||
this->val.str = new string_t(val);
|
||||
}
|
||||
value_t::value_t(bool_t val) {
|
||||
this->type = type_t::Bool;
|
||||
this->val.bl = val;
|
||||
@ -161,5 +165,10 @@ namespace ppc::data {
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
value_t &value_t::operator=(const char *other) {
|
||||
type = type_t::Str;
|
||||
val.str = new string_t(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user