src/util.c
// Draw the abstract syntax tree of a program.
Draw the abstract syntax tree of a program.
Draw the abstract syntax tree of a program .
void draw_ast(Prog *prog) {
    for (int i = 0; i < prog->fns->len; i++) {
        Func *fn = vec_at(prog->fns->vals, i);
        fprintf(stderr, "%s()\n", fn->name);
        draw_node(fn->body, 1, "");
        fprintf(stderr, "\n");
    }
}
void draw_ast ( Prog * prog ) { for ( int i = 0 ; i < prog -> fns -> len ; i ++ ) { Func * fn = vec_at ( prog -> fns -> vals , i ) ; fprintf ( stderr , " \n " , fn -> name ) ; draw_node ( fn -> body , 1 , " " ) ; fprintf ( stderr , " \n " ) ; } }
Draw the abstract syntax tree of a program.
Draw the abstract syntax tree of a program .