[Kde-bindings] twine2 (PyKDE5 code generator) parsing issues

Scott Kitterman kde at kitterman.com
Fri Apr 17 19:46:41 UTC 2015


On April 17, 2015 3:24:13 PM EDT, Luca <gluca86 at gmail.com> wrote:
>Hello Scott,
>I did some tests and I was able to build easily kconfig.
>
>The KCOREADDONS_DEPRECATED must be added to the qtkde5macros script. I 
>attached a patch I created, so you have an idea what I did.
>
>For the other errors are very specific.
>I found for instance that pointer are not handled correctly, and throw
>an 
>error.
>
>Also this line is problematic:
>typedef void (QObject::* NotifyFunction)(quint64 arg);
>
>Seems also that also this line is not handled:
>#ifndef KDE_NO_DEPRECATED
>I looked in pplexer.py but seems that the #ifndef definition is
>managed, don't 
>know why this generates an error.
>
>You are working on the official repository?
>I'm personally testing locally, I need this lib to port our SW to kf5
>on 
>Chakra linux.
>
>Luca
>
>In data giovedì, 16 aprile 2015 20.52:57, Scott Kitterman ha scritto:
>> I am running into some errors trying to generate bindings with the
>current
>> twine2 and Kf5 5.9.0 (this is before I dive in and refactor into a
>separate
>> module and possibly break things more).  It would be lovely if
>someone could
>> have a look at what's going on in these cases.
>> 
>> Parsing Cpp headers:
>> ...
>>     Parsing .../frameworks/kcoreaddons/src/lib/kaboutdata.h
>> File: '.../frameworks/kcoreaddons/src/lib/kaboutdata.h' Line: 570
>Syntax
>> error in input. Token type: AMPERSAND, token value: &, lex state:
>variable
>> 
>> Here's the code that's at Line 570:
>> 
>>     KCOREADDONS_DEPRECATED KAboutData &setProgramIconName(const
>QString
>> &iconName); // KF6 remove this
>> 
>> That's the only item marked deprecated, so I assume twine2 isn't
>handling
>> this case.
>> 
>> If I comment that out of the Kf5 source, I make it to the next error:
>> 
>> Parsing Cpp headers:
>> ...
>>     Parsing .../frameworks/kcoreaddons/src/lib/plugin/kpluginloader.h
>> File: '.../frameworks/kcoreaddons/src/lib/plugin/kpluginloader.h'
>Line: 310
>> Syntax error in input. Token type: LPAREN, token value: (, lex state:
>> function
>> 
>> Line 310 is the middle two of these four lines due to line wrapping
>in
>> email:
>> 
>>     static QList<QObject *> instantiatePlugins(const QString
>&directory,
>>             std::function<bool(const KPluginMetaData &)> filter =
>> std::function<bool(const KPluginMetaData &)>(),
>>             QObject* parent = Q_NULLPTR);
>> 
>> The same error happens at Line 330 in the same file the second two of
>the
>> three:
>> 
>>     static QVector<KPluginMetaData> findPlugins(const QString
>&directory,
>>             std::function<bool(const KPluginMetaData &)> filter =
>>  std::function<bool(const KPluginMetaData &)>());
>> 
>> and again at line 352 (again the second/third lines):
>> 
>>     static void forEachPlugin(const QString &directory,
>>             std::function<void(const QString &)> callback =
>> std::function<void(const QString &)>());
>> 
>> If I comment all those out, I at least get to the end of header
>parsing. 
>> I'm unlikely to be able to sort these out on my own, so it would be
>really
>> good if someone else could take a look.
>> 
>> Scott K
>> _______________________________________________
>> Kde-bindings mailing list
>> Kde-bindings at kde.org
>> https://mail.kde.org/mailman/listinfo/kde-bindings

I'm working off the twine2 repo in playground, which is now the official repository as I understand it. 

Thanks. 

Do you have commit access? If so, please commit your fixes. If not, I'll be glad to do it, but probably not until at least tomorrow. 

Scott K


More information about the Kde-bindings mailing list