From e31e03927ab0dce3f08a472d36fb82b7ea763899 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" <pesco@khjk.org> Date: Tue, 7 May 2013 18:51:42 +0200 Subject: [PATCH] don't output extraneous comma in symbol sets --- src/backends/ll.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backends/ll.c b/src/backends/ll.c index d791517c..5e68a3af 100644 --- a/src/backends/ll.c +++ b/src/backends/ll.c @@ -509,14 +509,17 @@ void h_pprint_symbolset(FILE *file, const HCFGrammar *g, const HHashSet *set, in // iterate over set size_t i; HHashTableEntry *hte; + const HCFChoice *a = NULL; for(i=0; i < set->capacity; i++) { for(hte = &set->contents[i]; hte; hte = hte->next) { if(hte->key == NULL) continue; - const HCFChoice *a = hte->key; // production's left-hand symbol + if(a != NULL) // we're not on the first element + fputc(',', file); + + a = hte->key; // production's left-hand symbol pprint_symbol(file, g, a); - fputc(',', file); } } -- GitLab