From 22dda0f00476e140b490979a3894d75ebc45b0cb Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 12 Jul 2005 15:58:49 +0000 Subject: [PATCH] * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments, for consistency with the rest of the code. * src/symlist.h, src/symlist.c (symbol_list_print): Ditto. Add separators. --- ChangeLog | 7 +++++++ src/symlist.c | 10 +++++++--- src/symlist.h | 2 +- src/symtab.c | 2 +- src/symtab.h | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index db7d815..c5885f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2005-07-12 Akim Demaille + * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments, + for consistency with the rest of the code. + * src/symlist.h, src/symlist.c (symbol_list_print): Ditto. + Add separators. + +2005-07-12 Akim Demaille + * src/parse-gram.y: Use %printer instead of YYPRINT. 2005-07-12 Akim Demaille diff --git a/src/symlist.c b/src/symlist.c index 662f1f7..106db46 100644 --- a/src/symlist.c +++ b/src/symlist.c @@ -49,10 +49,14 @@ symbol_list_new (symbol *sym, location loc) `------------------*/ void -symbol_list_print (FILE *f, symbol_list *l) +symbol_list_print (symbol_list *l, FILE *f) { - for (/* Nothing. */; l; l = l->next) - symbol_print (f, l->sym); + for (/* Nothing. */; l && l->sym; l = l->next) + { + symbol_print (l->sym, f); + if (l && l->sym) + fputc (' ', f); + } } diff --git a/src/symlist.h b/src/symlist.h index 135a8cd..e4714f6 100644 --- a/src/symlist.h +++ b/src/symlist.h @@ -45,7 +45,7 @@ typedef struct symbol_list symbol_list *symbol_list_new (symbol *sym, location loc); /* Print it. */ -void symbol_list_print (FILE *f, symbol_list *l); +void symbol_list_print (symbol_list *l, FILE *f); /* Prepend SYM at LOC to the LIST. */ symbol_list *symbol_list_prepend (symbol_list *list, diff --git a/src/symtab.c b/src/symtab.c index 84e59e9..edaf168 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -83,7 +83,7 @@ symbol_new (uniqstr tag, location loc) fprintf (stderr, " %s { %s }", #Attr, s->Attr) void -symbol_print (FILE *f, symbol *s) +symbol_print (symbol *s, FILE *f) { fprintf (stderr, "\"%s\"", s->tag); SYMBOL_ATTR_PRINT (type_name); diff --git a/src/symtab.h b/src/symtab.h index 725b6cb..61caa53 100644 --- a/src/symtab.h +++ b/src/symtab.h @@ -92,7 +92,7 @@ struct symbol #define NUMBER_UNDEFINED (-1) /* Print a symbol (for debugging). */ -void symbol_print (FILE *f, symbol *s); +void symbol_print (symbol *s, FILE *f); /* Fetch (or create) the symbol associated to KEY. */ symbol *symbol_get (const char *key, location loc); -- 2.7.4