refactor-error-handling #12

Merged
laentropia merged 11 commits from refactor-error-handling into main 2026-05-13 19:05:55 -06:00

11 Commits

Author SHA1 Message Date
ab791dbc9b fix: tests and main 2026-05-13 18:48:14 -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
b56a368244 refactor: bp funtions take tokens now
necessary for cleannes
2026-05-13 17:48:03 -06:00
6294121e91 refactor: nud and led have differetn responasblires
So now nud and led do what they were supposed to do i guess, now i
thinks is just adjusting infix and postfix and all bd funcions to act on
operator instead.
2026-05-13 17:35:52 -06:00
70ab06964c addtition: nud and led token to node distinction
I think i should instead have a nud and led function i guess, may do
that next
2026-05-13 16:09:03 -06:00
90c426f3a4 refactor: moved NodeResult to TreeResult 2026-05-13 12:19:17 -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
542a94ef81 refactor: All of parser.c
DAMN, it wasn't that difficult, just bothers me a bit the part that
checks if both lbp and rbp of the infix are valid, like i do validation
twice but is fine i guess, maybe using an else?, i'll see if i change
it, for now i need to change the evaluator
2026-05-13 11:09:22 -06:00
80e05a9acf refactor: changed parser.h, added Node
So just added node back but now clearly separated by tokens and nodes of
the AST as it should be, now real rework the mess that is the parser
2026-05-13 10:02:55 -06:00
f3373123e1 refactor: adapted lexer to work with new tokens
Now its fine, the code i find it clear if one just sits down to read it
for a moment, next is the parser that REALLY needs reworking and a few
helper structs.
2026-05-13 09:49:28 -06:00
2a73f5f9d6 refactor: delete ASTNode, add Token to lexer
So, total refactor, now we serious. I feel ASTNode was feeling very
bloated so we need to rewrite and adapt everything, by now lets get the
lexer working again, is already well written for me at least.
2026-05-13 09:37:15 -06:00