GNOME Bugzilla – Bug 563794
Redo annotation parsing & applying
Last modified: 2015-02-07 16:44:44 UTC
Annotation parsing is a bit messy right now. We should take advantage of having python ready and use to do as much as possible of the parsing. Annotation is also conceptually different from transforming, so the tasks should also be separated. (eg, separate modules) This is needed for sanity, especially since we soon have to parse annotations for signals and properties.
Created attachment 124228 [details] [review] v1: work in progress This patch is mainly removing a lot of code. It's doing all comment parsing in python code, and support Since/transfer/inout/out.
Created attachment 124320 [details] [review] v2: getting there This is the result of tonight's hacking. The new parser can almost parse the complete annotations specified in annotation.[ch]. Getting pretty close now.
This is looking quite good. I was about to start on bug 555036 and this patch would make it significantly easier (nearly trivial). Is this patch the latest? If so I may try to pick it up and finish it this weekend.
No, there's one newer version which passes annotation/drawable but still fails in a couple of places in foo. I'll attach it tomorrow. (just need to unpack the HD it's on)
Created attachment 125064 [details] [review] v3 Latest patch, against trunk. Misses porting of patch from bug 563934, should be too hard though.
Created attachment 125557 [details] [review] passes make check This version passes make check. Highlights are: * Handle fields+arrays specially; we can't really rely on annotation passes to turn things into Array because we don't have the parse tree around anymore, and we lose data without it * Key bugfixes: code was doing is_param = isinstance(node.type, Param) when foo.type is never a Param, but obviously node is See the interdiff for details
Created attachment 125558 [details] [review] include annotationparser.py Previous patch was lacking annotationparser.py (explaining how it somehow became smaller).
(In reply to comment #7) > Created an attachment (id=125558) [edit] > include annotationparser.py > > Previous patch was lacking annotationparser.py (explaining how it somehow > became smaller). > Woho! Thanks for completing this Colin. Looks great and all. I'm just slightly worried that it might break gir-repository, since there's plenty of annotations in there, some of the combinations might not be tested in g-i itself. I'd just like to verify that Gtk-2.0.gir doesn't change with this patch applied. Apart from that just commit it.
Created attachment 125673 [details] [review] v4 make check in gir-repository passes with this, however Gtk-2.0.gir has changed transfer of parameter from full to none for all object references, not sure why.
Created attachment 125684 [details] [review] v5 Updated for trunk after bug 556489 got solved, however make check doesn't pass any longer. We need to know if a parameter is referring to an object or interface to solve this properly.
I landed this, let's fix regressions as we find them, but it should really be quite okay.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]