Add support for sum expressions in evaluate()
This commit is contained in:
@@ -4,5 +4,7 @@ int evaluate(const expression_t *expression)
|
||||
{
|
||||
if (expression->is_number)
|
||||
return expression->number;
|
||||
return 0;
|
||||
const int x = evaluate(expression->application.operands[0]);
|
||||
const int y = evaluate(expression->application.operands[1]);
|
||||
return x + y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user