Review Request: Parser support for C99 designated initializers

Alexandre Courbot gnurou at gmail.com
Mon Dec 19 00:10:18 UTC 2011



> On Dec. 18, 2011, 8:41 p.m., Andreas Pakulat wrote:
> > How does the parser identify wether the code is C or C++? Currently the parser is C++ only, i.e. it only understands the parts of plain C that are also in C++. If more C support is added there needs to be a way to enable/disable this on a per-file basis so that users do not start using plain-C code that is going through a C++ compiler or vice versa. Otherwise KDevelop would quickly get bugreports about the parser being broken since it does not behave in the same way as the compiler.

That's a perfectly valid concern, but then: how does the parser identify whether the code is C++ or C++11? Right now it seems to me that it will gladly parse C++11 initializer lists and lambda functions in C++ code. I agree this issue should be addressed at some point, but we should not push back parser improvements because of that.


- Alexandre


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103448/#review9061
-----------------------------------------------------------


On Dec. 18, 2011, 12:23 p.m., Alexandre Courbot wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103448/
> -----------------------------------------------------------
> 
> (Updated Dec. 18, 2011, 12:23 p.m.)
> 
> 
> Review request for KDevelop and Milian Wolff.
> 
> 
> Description
> -------
> 
> 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,
> };
> 
> 
> Diffs
> -----
> 
>   languages/cpp/parser/parser.h ffc3967e9bec09ff56204aab98e8f80ec6b036cf 
>   languages/cpp/parser/parser.cpp 1c9d9e403500f35761ebc6deb737a4a68a53c28d 
>   languages/cpp/parser/tests/test_parser.h fa92f1ce284df0936724f74f42f9ad6d4b3c97fc 
>   languages/cpp/parser/tests/test_parser.cpp f747cfa44bdf962be33cf97841fdae739b3e1771 
> 
> Diff: http://git.reviewboard.kde.org/r/103448/diff/diff
> 
> 
> Testing
> -------
> 
> Used it for a couple of weeks, ensured the parser tests all pass.
> 
> 
> Thanks,
> 
> Alexandre Courbot
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20111219/a6820774/attachment.html>


More information about the KDevelop-devel mailing list