Skip to content

Commit

Permalink
Fix slice2js write doc lines implementation - #2994
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Oct 29, 2024
1 parent c9511fb commit f75814e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions cpp/src/slice2js/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,21 @@ namespace

void writeDocLines(Output& out, const StringList& lines, bool commentFirst, const string& space = " ")
{
StringList l = lines;
if (!commentFirst)
if (lines.size() > 0)
{
out << l.front();
l.pop_front();
}
for (StringList::const_iterator i = l.begin(); i != l.end(); ++i)
{
out << nl << " *";
if (!i->empty())
StringList l = lines;
if (!commentFirst)
{
out << space << *i;
out << l.front();
l.pop_front();
}
for (StringList::const_iterator i = l.begin(); i != l.end(); ++i)
{
out << nl << " *";
if (!i->empty())
{
out << space << *i;
}
}
}
}
Expand Down

0 comments on commit f75814e

Please sign in to comment.