AST building #2

Merged
TopchetoEU merged 74 commits from TopchetoEU/ast-building into master 2022-10-28 11:58:03 +00:00
2 changed files with 11 additions and 0 deletions
Showing only changes of commit 8264dc3de0 - Show all commits

View File

@ -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);

View File

@ -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;
}
}