#include "variable.hpp"
#include "context.hpp"

const std::string variable::type_name = "variable";

variable::variable(const std::string& n) : name(n) {}

variable* variable::clone() const {
    return new variable(name);
}

symbol_impl* variable::evaluate(const interpreter_context& context) const {
    return context.evaluate_identifier(name);
}

std::string variable::serialize(const interpreter_context&) const {
    return name;
}

const std::string& variable::type() const {
    return type_name;
}

bool variable::is_litteral() const {
    return false;
}

std::pair<size_t,size_t> variable::priority(const interpreter_context&) const {
    return std::pair<size_t,size_t>(0, 0);
}
