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

Scott Kitterman kde at kitterman.com
Fri Apr 17 00:52:57 UTC 2015


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


More information about the Kde-bindings mailing list