well, nothing works, at least there is something to debug
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user