Second test, just pop, almost identical to first put important for asserting pop works because it is very needed

This commit is contained in:
2026-03-05 10:20:44 -06:00
parent 79f7e327ff
commit 194f1dd80f
2 changed files with 44 additions and 8 deletions

View File

@@ -7,7 +7,7 @@
// For identifing
typedef enum {
NODE_NUMBER,
NODE_OPERATOR,
NODE_BINARY_OP,
} ASTNodeType;
// For classify operators
@@ -41,10 +41,12 @@ typedef struct ASTNode {
ASTNodeType type;
union {
double number;
struct ASTNode *left;
struct ASTNode *right;
Operator op;
} operator;
struct {
struct ASTNode *left;
struct ASTNode *right;
Operator op;
} binary;
} data;
} ASTNode;
// I prefer ot have a dynamic array for storing the "tokens"