#ifndef _CLI_VARIABLE_EXPRESSION_H_
#define _CLI_VARIABLE_EXPRESSION_H_

#include <alib/string>
#include <ast/Expression.h>

namespace cli {

class VariableExpression final : public Expression {
	std::unique_ptr < cli::Arg > m_name;

public:
	VariableExpression ( std::unique_ptr < cli::Arg > name ) : m_name ( std::move ( name ) ) {
	}

	std::shared_ptr < abstraction::Value > translateAndEval ( Environment & environment ) const override {
		return environment.getVariable ( m_name->eval ( environment ) );
	}

};

} /* namespace cli */

#endif /* _CLI_VARIABLE_EXPRESSION_H_ */
