summaryrefslogtreecommitdiff
path: root/src/ast_pretty_printer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast_pretty_printer.c')
-rw-r--r--src/ast_pretty_printer.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ast_pretty_printer.c b/src/ast_pretty_printer.c
index 718d22a..e2d007a 100644
--- a/src/ast_pretty_printer.c
+++ b/src/ast_pretty_printer.c
@@ -63,6 +63,31 @@ ast_pretty_printer_print_ast(ast_pretty_printer_t *printer, ast_node_t *ast)
assert(ast);
switch (ast->kind) {
+ case AST_IF_STMT: {
+ ast_if_stmt_t if_stmt = ast->data.if_stmt;
+ ast_pretty_printer_printf(printer, "IfStmt\n");
+ ast_pretty_printer_add_indentation(printer);
+ {
+ ast_pretty_printer_printf(printer, "condition:\n");
+ ast_pretty_printer_add_indentation(printer);
+ {
+ ast_pretty_printer_set_lst_children(printer);
+ ast_pretty_printer_print_ast(printer, if_stmt.condition);
+
+ ast_pretty_printer_rm_indentation(printer);
+ }
+ ast_pretty_printer_printf(printer, "body:\n");
+ ast_pretty_printer_add_indentation(printer);
+ {
+ ast_pretty_printer_set_lst_children(printer);
+ ast_pretty_printer_print_ast(printer, if_stmt.body);
+
+ ast_pretty_printer_rm_indentation(printer);
+ }
+ ast_pretty_printer_rm_indentation(printer);
+ }
+ break;
+ }
case AST_BINARY_OPERATION: {
ast_binary_operation_t binop = ast->data.binary_operation;
ast_pretty_printer_printf(printer, "BinaryOperation operation='%c'\n", operation_kinds[binop.kind]);