fixed compound node

This commit is contained in:
Lorenzo Torres 2025-12-03 22:17:55 +01:00
parent df1b336c7c
commit 21b43af69d
7 changed files with 117 additions and 102 deletions

3
lc.c
View file

@ -127,6 +127,7 @@ void print_ast(ast_node *node, int depth) {
for (usize i = 0; i < node->expr.compound.stmt_len; ++i) {
print_ast(node->expr.compound.statements[i], depth + 1);
}
break;
case NODE_CALL:
printf("Call: %.*s\n", (int)node->expr.call.name_len, node->expr.call.name);
current = node->expr.call.parameters;
@ -219,7 +220,7 @@ void print_ast(ast_node *node, int depth) {
int main(void)
{
FILE *fp = fopen("test.l", "r");
FILE *fp = fopen("examples/for.l", "r");
usize size = 0;
fseek(fp, 0, SEEK_END);
size = ftell(fp);