rework: AST now uses an arena for allocation
For now it works but i dont really like that i use ParseResult, i mean is necessary but i think i will try to make it cleaner so that i can just directly use like parse and pass tath into evaluate, that would require to move the main evaluate funciton into evaluate_tree or something and evaluate takes the arena, uses evaluate_tree and frees the arena, will try that the next commit but for now this version works perfectly.
This commit is contained in:
@@ -3,6 +3,7 @@ find_package(cmocka REQUIRED)
|
||||
add_executable(test_nodeArray test_ASTNodeArray.c)
|
||||
add_executable(test_lexer test_lexer.c)
|
||||
add_executable(test_parser test_parser.c)
|
||||
add_executable(test_evaluator test_evaluator.c)
|
||||
|
||||
target_link_libraries(test_nodeArray
|
||||
calculator_lib
|
||||
@@ -19,6 +20,12 @@ target_link_libraries(test_parser
|
||||
cmocka::cmocka
|
||||
)
|
||||
|
||||
target_link_libraries(test_evaluator
|
||||
calculator_lib
|
||||
cmocka::cmocka
|
||||
)
|
||||
|
||||
add_test(NAME nodeArray_tests COMMAND test_nodeArray)
|
||||
add_test(NAME lexer_tests COMMAND test_lexer)
|
||||
add_test(NAME parser_tests COMMAND test_parser)
|
||||
add_test(NAME evaluator_tests COMMAND test_evaluator)
|
||||
|
||||
Reference in New Issue
Block a user