From aba7302e7e98fd7bca2056d8ad622d9ca81c495f Mon Sep 17 00:00:00 2001 From: Carlos Maniero Date: Mon, 8 May 2023 23:53:41 -0300 Subject: parser: Add the bool type This commit introduces a new type for booleans. There is no code generation for this type yet. The intention of this commit is to enable flow control in the near future. Signed-off-by: Carlos Maniero Reviewed-by: Johnny Richard --- src/ast_pretty_printer.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ast_pretty_printer.c') diff --git a/src/ast_pretty_printer.c b/src/ast_pretty_printer.c index ec8d2de..95f5993 100644 --- a/src/ast_pretty_printer.c +++ b/src/ast_pretty_printer.c @@ -117,6 +117,11 @@ ast_pretty_printer_print_ast(ast_pretty_printer_t *printer, ast_node_t *ast) ast_pretty_printer_printf(printer, "Literal type=i32 value='%d'\n", literal.value.integer); break; } + case AST_LITERAL_BOOL: + ast_pretty_printer_set_lst_children(printer); + ast_pretty_printer_printf( + printer, "Literal type=bool value='%s'\n", literal.value.boolean ? "true" : "false"); + break; } break; } -- cgit v1.2.3