implemented simple evaluator for program,

statements and integer literals, together with
tests
This commit is contained in:
Karma Riuk
2025-07-19 15:03:38 +02:00
parent 7b01840f4d
commit 47379c6635
9 changed files with 105 additions and 0 deletions

10
test/utils/test_eval.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include "object/integers.hpp"
#include "object/object.hpp"
#include "utils.hpp"
namespace test::utils {
void test_integer_object(object::object* obj, int expected) {
object::integer* i = cast<object::integer>(obj);
CHECK(i->value == expected);
}
} // namespace test::utils