#ifndef STRING_HPP
#define STRING_HPP

#include "symbol.hpp"

class string : public symbol_impl {
public :
    std::string str;

    explicit string(const std::string& s);

    string* clone() const override;
    symbol_impl* evaluate(const interpreter_context& context) const override;
    std::string serialize(const interpreter_context& context) const override;
    const std::string& type() const override;
    bool is_litteral() const override;
    std::pair<size_t,size_t> priority(const interpreter_context&) const override;

    static const std::string type_name;

    static void reg(interpreter_context& context);
};

#include <vector>
#include <sstream>

std::vector<std::string> split_token(const std::string& str, const std::string& token);
std::vector<std::string> split(const std::string& str, const std::string& tokens);
void replace(std::string& str, const std::string& token, const std::string& rep);
template<typename T>
std::string to_string(const T& t) {
    std::stringstream ss;
    ss << t;
    return ss.str();
}

#endif
