<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/103448/">http://git.reviewboard.kde.org/r/103448/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On April 15th, 2012, 11:42 a.m., <b>Milian Wolff</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/103448/diff/4/?file=56665#file56665line2869" style="color: black; font-weight: bold; text-decoration: underline;">languages/cpp/parser/parser.cpp</a>
<span style="font-weight: normal;">
(Diff revision 4)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool Parser::parseDesignatedInitializer(InitializerClauseAST *&ast)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">2869</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">goto</span> <span class="n">error</span><span class="p">;</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">please don't use goto, just copy the rewind + return clause here
though actually there is afaiks even a macro defined that checks the lookahead + returns on error</pre>
</blockquote>
<p>On April 15th, 2012, 12:45 p.m., <b>Alexandre Courbot</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The macro would be CHECK I guess, but it does not rewind and automatically advances on success, which is not always what I need here.
About the gotos: you might not have spotted them, but there are 3 more of them in this function. Their purpose is to avoid duplicating common error-handling code by having it after the error-free return of the function. What is wrong with them, especially here? They are actually useful. And this is not the only place where they are used in the parser.</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Yes, there are other places that use goto and they should be removed as well imo. Better introduce a new macro or function that does this, then using goto which we try to avoid.</pre>
<br />
<p>- Milian</p>
<br />
<p>On April 15th, 2012, 7:20 a.m., Alexandre Courbot wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KDevelop and Milian Wolff.</div>
<div>By Alexandre Courbot.</div>
<p style="color: grey;"><i>Updated April 15, 2012, 7:20 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Parser support for C99 designated initializers
Support C99 initializers in the C++ parser, e.g:
struct foo_t foo = {
.has_cake = true,
.nb_candles = 12,
};
int bar[10] = {
[1] = 15,
[9] = 25,
};
REVIEW: 103448</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Used it for a couple of weeks, ensured the parser tests all pass.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>languages/cpp/parser/parser.h <span style="color: grey">(64b5c505866ac2a0ed847aa67e4c7809df3af6b5)</span></li>
<li>languages/cpp/parser/parser.cpp <span style="color: grey">(a45ee31a1207d56efef292babb2e774b51378ead)</span></li>
<li>languages/cpp/parser/tests/test_parser.h <span style="color: grey">(2869d9ddae2632aced2f2e2fa966382da3a0082d)</span></li>
<li>languages/cpp/parser/tests/test_parser.cpp <span style="color: grey">(94e3ee06dc9187568c000dcdd8baf8d87d1d06e6)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/103448/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>