Made getValue for variable have a const parameter since things don't change
This commit is contained in:
parent
d740cc17af
commit
d486a64052
2 changed files with 2 additions and 8 deletions
|
@ -7,7 +7,7 @@ void set_value(Variable* var, Value* value) {
|
||||||
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; }
|
if (!var) { std::cerr << "Error: Invalid Variable" << std::endl; return 0; }
|
||||||
return var->value;
|
return var->value;
|
||||||
}
|
}
|
|
@ -23,12 +23,6 @@ class Variable {
|
||||||
|
|
||||||
// Variable Functions
|
// Variable Functions
|
||||||
void set_value(Variable* var, Value* value);
|
void set_value(Variable* var, Value* value);
|
||||||
Value* get_value(Variable* var);
|
Value* get_value(const 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);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Reference in a new issue