don't output extraneous comma in symbol sets
This commit is contained in:
parent
16f933013a
commit
e31e03927a
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue