From 34114ca4516fd29f53ed428149f25ed89d770d32 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Tue, 12 May 2026 23:00:03 +0100 Subject: [PATCH] debug: add print support for new ast node types --- bshell/debug.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/bshell/debug.c b/bshell/debug.c index fa83626..c8e6ca1 100644 --- a/bshell/debug.c +++ b/bshell/debug.c @@ -24,6 +24,8 @@ extern void print_lex_token(struct lex_token *tok) break; case TOK_INT: case TOK_DOUBLE: + case TOK_VAR: + case TOK_VAR_SPLAT: fx_puts("[yellow]"); break; case TOK_OPERATOR: @@ -32,16 +34,10 @@ extern void print_lex_token(struct lex_token *tok) case TOK_WORD: case TOK_WORD_START: case TOK_WORD_END: - case TOK_VAR: - case TOK_VAR_SPLAT: fx_puts("[cyan]"); break; case TOK_STRING: - fx_puts("[green]"); - break; case TOK_STR_START: - fx_puts("[green]"); - break; case TOK_STR_END: fx_puts("[green]"); break; @@ -100,15 +96,28 @@ void print_ast_node(struct ast_node *node) } switch (node->n_type) { + case AST_IF: + case AST_IF_BRANCH: + case AST_BLOCK: + case AST_FUNC: + case AST_STMT_LIST: + fx_puts("[magenta]"); + break; case AST_REDIRECTION: case AST_PIPELINE: + case AST_OP: + case AST_ARRAY: + case AST_HASHTABLE: + case AST_HASHTABLE_ITEM: fx_puts("[blue]"); break; case AST_CMDCALL: + case AST_NULL: fx_puts("[red]"); break; case AST_INT: case AST_DOUBLE: + case AST_VAR: fx_puts("[yellow]"); break; case AST_WORD: