well, nothing works, at least there is something to debug

This commit is contained in:
2026-03-25 07:43:00 -06:00
parent f11b6f8c12
commit f24671bd19
4 changed files with 78 additions and 6 deletions

View File

@@ -1,7 +1,17 @@
#include "lexer.h"
#include "parser.h"
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
puts("Hello");
int main(void) {
ASTNodeArray context;
tokenize("3 + 4 * 5", &context);
AST tree = parse(&context);
print_AST(tree);
printf("Hola\n");
return EXIT_SUCCESS;
}

View File

@@ -107,7 +107,9 @@ void print_AST(AST tree) {
}
void print_node(ASTNode *node, int depth) {
if (!node) return;
if (node == NULL) {
return;
}
if (node->type == NODE_BINARY_OP) {
print_node(node->data.binary.right, depth + 1);