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
This commit is contained in:
2026-05-13 12:13:07 -06:00
parent 542a94ef81
commit efa0e3bacd
5 changed files with 111 additions and 20 deletions

View File

@@ -27,6 +27,7 @@ TokenizeResult tokenize(const char *input) {
TokenResult result = tokenize_number(input, &offset);
if (!result.is_valid) {
arraylist_destroy(&arr);
return (TokenizeResult) {.is_valid = false, .err = result.err};
}
@@ -41,6 +42,7 @@ TokenizeResult tokenize(const char *input) {
} else if (isspace(input[offset])) {
// Nothing...
} else {
arraylist_destroy(&arr);
return (TokenizeResult) {
.is_valid = false,
.err = LEXER_NOT_RECOGNIZED_SYMBOL};
@@ -50,6 +52,7 @@ TokenizeResult tokenize(const char *input) {
}
if (arraylist_size(arr) < 1) {
arraylist_destroy(&arr);
return (TokenizeResult) {.is_valid = false, .err = LEXER_EMPTY_INPUT};
}