t-artistik / qtscriptgenerator

Automatically exported from code.google.com/p/qtscriptgenerator
0 stars 0 forks source link

Parser bug: template specializations #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently the parser doesn't parse template specializations
correctly, it requires illegal C++:

    template<>
    void Class<void>::foo(){}

instead of 
    void Class<void>::foo(){}
only.

Here is a patch:
http://lists.kde.org/?l=kde-commits&m=121935024418698&w=2

Maybe the TODO could also be resolved by fixing the lexer.

(cpptoxml is used by the lua binding)

Original issue reported on code.google.com by syntheti...@gmx.net on 21 Aug 2008 at 8:47

GoogleCodeExporter commented 8 years ago
More details: 
You get a warning when the parser sees above code.

The bug is that the parser doesn't sees that the following 
is a class:

template<>
class Class<void> 

There are no template parameters in <>, in the patch the line with
if (it == 0) {.
There we have simply to add the class. The other line with 'endsWith'
is due to the fact that there we have 'Class>', the mentioned 
lexer(?) bug.

Original comment by syntheti...@gmx.net on 21 Aug 2008 at 8:58