Implement number evaluation
This commit is contained in:
8
lib/evaluator.c
Normal file
8
lib/evaluator.c
Normal 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
8
lib/include/evaluator.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef EVALUATOR_H
|
||||
#define EVALUATOR_H
|
||||
|
||||
#include "expression.h"
|
||||
|
||||
int evaluate(const expression_t *expression);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user