9 Commits

Author SHA1 Message Date
964034b203 fix: updating arena and arraylist use 2026-05-14 08:36:21 -06:00
3ec73559ee refactor: evaluator separated into evaluate bin and un
Is nicer this way, also made it more beautiful to look at and therefor
to understand.
2026-05-13 18:06:01 -06:00
efa0e3bacd refactor: evaluator incomplete.
SO, i forgot to implement nud and led correctly and the parser cant tell
apart from - as unary and - as binary (+ as well), i need to correct
that, move Node * to TreeResult so to use NodeResult with nud and led
2026-05-13 12:13:07 -06:00
7ad4eba123 fix/refactor: Modified evaluate and changed it to evaluate_tree
So i did what the last commit said, also fixed parse_expr because it was
still using malloc for allocating new nodes so i made it use arena_alloc
like it should, did the very first tests so it's all good, i think is
readdy to merge.
2026-04-13 08:44:30 -06:00
e4ec102cb9 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.
2026-04-13 07:57:36 -06:00
fb27e1e34c addition: added arena library to this shit 2026-04-13 06:40:31 -06:00
1ce64d8e9e Fixed many minor things, tested it on main and is amazing, i think i need to start adding fractions next so further testing can be done with more powerful operators 2026-03-25 12:25:15 -06:00
92d142b9cf It works, basic but works, need to move out logic to places, like ASTNode array shouldn't be on the lexer or future logic for fractions and error handling in the evaluator. Just the things at the top of my head 2026-03-25 11:30:12 -06:00
317e9f3b6b Jut setting all up for the calculator 2026-02-28 13:59:02 -06:00