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.
This commit is contained in:
2026-05-13 17:35:52 -06:00
parent 70ab06964c
commit 6294121e91
2 changed files with 209 additions and 288 deletions

View File

@@ -38,6 +38,7 @@ typedef enum {
PARSER_UNMATCHED_PAREN,
PARSER_OUT_OF_MEMORY,
PARSER_INVALID_TOKENIZE,
PARSER_UNEXMECTED_EOF,
} ParserErr;
typedef struct {
@@ -76,8 +77,8 @@ typedef struct {
} ParserU8Result;
Node token_to_node(Token token);
NodeResult nud(Token token); // Null denotation
NodeResult led(Token token); // Left denotation
TreeResult nud(ArraySlice *slice, Arena *arena, Token token); // Null denotation
TreeResult led(ArraySlice *slice, Arena *arena, Node *left, Token token); // Left denotation
ParserU8Result prefix_rbp(Node node);
ParserU8Result postfix_lbp(Node node);