Implement number evaluation

This commit is contained in:
2024-10-24 13:52:50 +01:00
parent 3bc640b656
commit 29deffdce9
5 changed files with 55 additions and 1 deletions

8
lib/evaluator.c Normal file
View File

@@ -0,0 +1,8 @@
#include "evaluator.h"
int evaluate(const expression_t *expression)
{
if (expression->is_number)
return expression->number;
return 0;
}

8
lib/include/evaluator.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef EVALUATOR_H
#define EVALUATOR_H
#include "expression.h"
int evaluate(const expression_t *expression);
#endif