From b6a9fa7512897dc1420549c511561b94f722d34c Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sun, 25 Feb 2024 19:19:50 +0100 Subject: [PATCH] :fire: various improvements --- include/gwfmt.h | 1 + include/gwfmt_internal.h | 1 - src/lint.c | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/gwfmt.h b/include/gwfmt.h index 2901690..63e864c 100644 --- a/include/gwfmt.h +++ b/include/gwfmt.h @@ -54,3 +54,4 @@ ANN void gwfmt_fptr_def(Gwfmt *a, Fptr_Def b); ANN void gwfmt_type_def(Gwfmt *a, Type_Def b); ANN void gwfmt_prim_def(Gwfmt *a, Prim_Def b); ANN void gwfmt_ast(Gwfmt *a, Ast b); +ANN void gwfmt_type_decl(Gwfmt *a, const Type_Decl *b); diff --git a/include/gwfmt_internal.h b/include/gwfmt_internal.h index d59fc1b..703a98a 100644 --- a/include/gwfmt_internal.h +++ b/include/gwfmt_internal.h @@ -4,7 +4,6 @@ ANN static void gwfmt_id_list(Gwfmt *a, ID_List b); ANN static void gwfmt_tmplarg_list(Gwfmt *a, TmplArg_List b); ANN static void gwfmt_tmpl(Gwfmt *a, Tmpl *b); ANN static void gwfmt_range(Gwfmt *a, Range *b); -ANN static void gwfmt_type_decl(Gwfmt *a, Type_Decl *b); ANN static void gwfmt_prim_id(Gwfmt *a, Symbol *b); ANN static void gwfmt_prim_num(Gwfmt *a, struct gwint *b); ANN static void gwfmt_prim_float(Gwfmt *a, m_float *b); diff --git a/src/lint.c b/src/lint.c index 4b98e34..aef33c7 100644 --- a/src/lint.c +++ b/src/lint.c @@ -354,7 +354,7 @@ ANN static void gwfmt_effects(Gwfmt *a, Vector b) { gwfmt_effect(a, (Symbol)vector_back(b)); } -ANN static void gwfmt_type_decl(Gwfmt *a, Type_Decl *b) { +ANN void gwfmt_type_decl(Gwfmt *a, const Type_Decl *b) { if (GET_FLAG(b, const)) { COLOR(a, "{+G}", "const"); gwfmt_space(a); @@ -953,12 +953,12 @@ ANN static void gwfmt_stmt_for(Gwfmt *a, Stmt_For b) { ANN static void gwfmt_stmt_each(Gwfmt *a, Stmt_Each b) { COLOR(a, "{+M}", "foreach"); gwfmt_lparen(a); - if(b->idx) { - gwfmt_symbol(a, b->idx->var.tag.sym); + if(b->idx.tag.sym) { + gwfmt_symbol(a, b->idx.tag.sym); gwfmt_comma(a); gwfmt_space(a); } - gwfmt_symbol(a, b->tag.sym); + gwfmt_symbol(a, b->var.tag.sym); gwfmt_space(a); COLOR(a, "{-}", ":"); gwfmt_space(a); @@ -971,8 +971,8 @@ ANN static void gwfmt_stmt_each(Gwfmt *a, Stmt_Each b) { ANN static void gwfmt_stmt_loop(Gwfmt *a, Stmt_Loop b) { COLOR(a, "{+M}", "repeat"); gwfmt_lparen(a); - if (b->idx) { - gwfmt_symbol(a, b->idx->var.tag.sym); + if (b->idx.tag.sym) { + gwfmt_symbol(a, b->idx.tag.sym); gwfmt_comma(a); gwfmt_space(a); }