A simple scripting language in C++
Ferenc Szontágh
2025-04-17 ba9a9199d01b0fdd4bf9a54914f8058bf71f30c5
src/Symbols/BaseSymbol.hpp
@@ -13,7 +13,7 @@
  protected:
    std::string   name_;
    Value         value_;
    std::string   context_;
    std::string   context_; // ns
    Symbols::Kind kind_;
  public:
@@ -40,6 +40,15 @@
    virtual void setValue(const Value & value) { value_ = value; }
    std::string dump() const {
        std::string r = "\t\t  "+ kindToString(this->kind_) + " name: '" + name_ + "' \n\t\t\tContext: " + context_;
        r += " \n\t\t\tType: " + Symbols::Variables::TypeToString(value_.getType());
        r += " \n\t\t\tValue: '" + Symbols::Value::to_string(value_) + "'";
        return r;
    }
    // Templated getter
    template <typename T> T getAs() const { return std::get<T>(value_); }
};