Archived
1
0
Fork 0

Made getValue for variable have a const parameter since things don't change

This commit is contained in:
Brandon Rozek 2018-09-28 22:53:41 -04:00
parent d740cc17af
commit d486a64052
2 changed files with 2 additions and 8 deletions

View file

@ -7,7 +7,7 @@ void set_value(Variable* var, Value* value) {
var->value = value;
}
Value* get_value(Variable* var) {
Value* get_value(const Variable* var) {
if (!var) { std::cerr << "Error: Invalid Variable" << std::endl; return 0; }
return var->value;
}

View file

@ -23,12 +23,6 @@ class Variable {
// Variable Functions
void set_value(Variable* var, Value* value);
Value* get_value(Variable* var);
Value* make_long(long num);
Value* make_double(double dec);
Value* make_true();
Value* make_false();
Value* make_boolean(int x);
Value* make_expression(Node* expr);
Value* get_value(const Variable* var);
#endif