Fix bug in printing trailing comma when dumping AST for a structure.

This commit is contained in:
Ashwin Lele 2019-07-17 14:40:58 -07:00
parent 74426f7570
commit a76d1c211b
8 changed files with 28 additions and 26 deletions

View file

@ -2050,13 +2050,15 @@ public:
// Add struct/block members
if (isStruct() && structure) {
appendStr("{");
bool hasHiddenMember = true;
for (size_t i = 0; i < structure->size(); ++i) {
if (! (*structure)[i].type->hiddenMember()) {
if (!hasHiddenMember)
appendStr(", ");
typeString.append((*structure)[i].type->getCompleteString());
typeString.append(" ");
typeString.append((*structure)[i].type->getFieldName());
if (i < structure->size() - 1)
appendStr(", ");
hasHiddenMember = false;
}
}
appendStr("}");