Skip to content

Commit

Permalink
THRIFT-3559 Fix awkward extra semi-colons with Cocoa container literals
Browse files Browse the repository at this point in the history
Client: Cocoa
Patch: Kevin Wooten

This closes #797
  • Loading branch information
kdubb authored and Jens-G committed Apr 16, 2016
1 parent 9f7f11e commit 4b7abed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions compiler/cpp/src/generate/t_cocoa_generator.cc
Expand Up @@ -2767,7 +2767,7 @@ void t_cocoa_generator::print_const_value(ostream& out,
mapout << ", ";
}
}
mapout << "};" << endl;
mapout << "}";
out << mapout.str();
} else if (type->is_list()) {
ostringstream listout;
Expand All @@ -2784,7 +2784,7 @@ void t_cocoa_generator::print_const_value(ostream& out,
listout << ", ";
}
}
listout << "];" << endl;
listout << "]";
out << listout.str();
} else if (type->is_set()) {
ostringstream setout;
Expand All @@ -2794,14 +2794,14 @@ void t_cocoa_generator::print_const_value(ostream& out,
vector<t_const_value*>::const_iterator v_iter;
if (defval)
setout << type_name(type) << " ";
setout << name << " = [[NSSet alloc] initWithArray:@[";
setout << name << " = [NSSet setWithArray:@[";
for (v_iter = val.begin(); v_iter != val.end();) {
setout << render_const_value(out, etype, *v_iter, true);
if (++v_iter != val.end()) {
setout << ", ";
}
}
setout << "]];" << endl;
setout << "]]";
out << setout.str();
} else {
throw "compiler error: no const of type " + type->get_name();
Expand Down Expand Up @@ -2849,6 +2849,7 @@ string t_cocoa_generator::render_const_value(ostream& out,
} else {
string t = tmp("tmp");
print_const_value(out, t, type, value, true);
out << ";" << endl;
render << t;
}

Expand Down

0 comments on commit 4b7abed

Please sign in to comment.