summaryrefslogtreecommitdiff
path: root/giscanner/annotationparser.py
Commit message (Collapse)AuthorAgeFilesLines
* Add a floating alias for noneJohan Dahlin2011-11-251-1/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=657202
* Add constant value annotationJohan Dahlin2011-09-141-1/+3
| | | | | Add an annotation tag "Value:" which can be used on constants to override the value.
* annotationparser: Don't eat lines that look like parameters outside param listColin Walters2011-08-141-4/+10
| | | | | | | | | If we're done parsing parameters, previously we would simply eat lines that looked like @foo: blah blah Example is in gtkcssprovider.c. https://bugzilla.gnome.org/show_bug.cgi?id=656504
* annotationparser: Only accept certain tagsColin Walters2011-08-131-3/+17
| | | | | | | | | | | Previously we were eating any line form "* [A-Za-z]: " as a tag, but this is a problem since e.g. gtk/gtk/gtkcssprovder.c had literal CSS e.g. block: which erroneously matched. Fix this by only accepting particular tags, similar to what gtk-doc does (although we accept a superset, e.g. transfer too). https://bugzilla.gnome.org/show_bug.cgi?id=656458
* scanner: Don't throw away blank lines in the docsColin Walters2011-08-131-3/+10
| | | | | | For generating documentation, we actually want to preserve these. https://bugzilla.gnome.org/show_bug.cgi?id=656389
* giscanner: Make comments starting with tab characters workJasper St. Pierre2011-07-221-3/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=655149
* Add (method) overridesTomeu Vizoso2011-02-021-1/+5
| | | | | | So methods such as gtk_drag_dest_set() can be put inside Gtk.Widget https://bugzilla.gnome.org/show_bug.cgi?id=639945
* Preserve gtk-doc section namesJohan Dahlin2011-02-011-3/+9
| | | | | Preserve the section names and write them out on the class/record/ interface.
* Add (constructor) annotationTomeu Vizoso2011-01-281-1/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=561264
* Accept trailing whitespace at the start of a comment blockColin Walters2010-10-191-5/+3
| | | | | | Might as well be liberal here, as long as we have a test case. https://bugzilla.gnome.org/show_bug.cgi?id=631690
* annotationparser: Don't ignore annotations if there's a : in docsGOBJECT_INTROSPECTION_0_9_8Colin Walters2010-09-281-1/+5
| | | | | | | | The annotation parser changed to be stricter about annotation content, but we introduced a regression where a : in the documentation would wrongly cause the annotation to be skipped. https://bugzilla.gnome.org/show_bug.cgi?id=630862
* [annotationparser] Extract (skip) for doc blocksJohan Dahlin2010-09-251-1/+8
|
* Print out line numbersJohan Dahlin2010-09-241-3/+7
| | | | | But disable the printing by default since it messes up the generated file. And fix a couple of typos
* Add a script to extract gio annotationsJohan Dahlin2010-09-241-2/+6
|
* Add an annotation toolJohan Dahlin2010-09-241-0/+52
|
* [annotationparser] Allow param less closuresJohan Dahlin2010-09-241-1/+5
| | | | | Allow closures without annotations to avoid having to duplicate the parameter name.
* Add more array warnings + testsJohan Dahlin2010-09-241-5/+25
|
* [annotationparser] Validate the rest of the annotationsJohan Dahlin2010-09-241-19/+87
| | | | | All option annotations, which uses parenthesis are now properly validated for number of values they expect
* Add a position to doc optionsJohan Dahlin2010-09-241-2/+8
|
* [annotation] Add constants for out optionsJohan Dahlin2010-09-241-0/+4
|
* Add scope annotation value warningsJohan Dahlin2010-09-231-15/+39
| | | | | Refactor and improve the warning messages for the transfer warnings as well
* Make the invalid annotation warning a bit prettierJohan Dahlin2010-09-231-1/+1
|
* Validate transfer annnotationsJohan Dahlin2010-09-231-1/+25
|
* Remove TAG_TRANSFERJohan Dahlin2010-09-231-1/+0
|
* [annotationparser] Make it a bit stricterJohan Dahlin2010-09-231-1/+12
| | | | | | | Don't parse annotations on lines such as: '@param: This is a foo (eg, bar) else: x' Where there's content between the last ) and the :.
* [scanner] Warn for invalid scanner annotationsJohan Dahlin2010-09-231-9/+72
| | | | | | Warn for invalid annotations. Change so that custom attributes have to use the annotation keyword.
* [scanner] Add a Position classJohan Dahlin2010-09-201-10/+4
| | | | | | Add a position class which will make it easier to send filename/line/column information to the message class.
* [annotationparser] Preserve line numbersJohan Dahlin2010-09-191-17/+35
| | | | | | | | Make sure that the linenumbers of the documentation blocks and tags are preserved and accurate so they can be used in warning messages. Also: * Rename Options to DocOptions for consistency * Add a reference to the docblock a tag and an option belong to
* Save the line number of a source commentJohan Dahlin2010-09-191-1/+2
|
* Add a parameter mismatch warningJohan Dahlin2010-09-141-0/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=629708
* [annotationparser] Send in comments directlyJohan Dahlin2010-09-021-4/+3
|
* Major rewriteColin Walters2010-08-311-729/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the first big changes in this rewrite is changing the Type object to have separate target_fundamental and target_giname properties, rather than just being strings. Previously in the scanner, it was awful because we used heuristics around strings. The ast.py is refactored so that not everything is a Node - that was a rather useless abstraction. Now, only things which can have a GIName are Node. E.g. Type and Field are no longer Node. More things were merged from glibast.py into ast.py, since it isn't a very useful split. transformer.py gains more intelligence and will e.g. turn GLib.List into a List() object earlier. The namespace processing is a lot cleaner now; since we parse the included .girs, we know the C prefix for each namespace, and have functions to parse both C type names (GtkFooBar) and symbols gtk_foo_bar into their symbols cleanly. Type resolution is much, much saner because we know Type(target_giname=Gtk.Foo) maps to the namespace Gtk. glibtransformer.py now just handles the XML processing from the dump, and a few miscellaneous things. The major heavy lifting now lives in primarytransformer.py, which is a combination of most of annotationparser.py and half of glibtransformer.py. annotationparser.py now literally just parses annotations; it's no longer in the business of e.g. guessing transfer too. finaltransformer.py is a new file which does post-analysis for "introspectability" mainly. girparser.c is fixed for some introspectable=0 processing.
* Use GLib types consistentlyColin Walters2010-08-311-1/+1
| | | | | | | | | Rather than have the scanner/parser handle both e.g. "glong" and "long", simply use the GLib types everywhere. This commit adds TYPE_LONG_LONG and TYPE_LONG_DOUBLE to the scanner types; however, rather than add them to the typelib, they're just marked as not-introspectable.
* Add support for non-GObject fundamental objectsJohan Dahlin2010-07-091-0/+15
| | | | | | | | | | | | | | This patch adds support for instantiable fundamental object types, which are not GObject based. This is mostly interesting for being able to support GstMiniObject's which are extensivly used in GStreamer. Includes a big test case to the Everything module (inspired by GstMiniObject) which should be used by language bindings who wishes to test this functionallity. This patch increases the size of the typelib and breaks compatibility with older typelibs. https://bugzilla.gnome.org/show_bug.cgi?id=568913
* Initialize value memberColin Walters2010-06-251-0/+1
|
* Clean up annotation parsing, don't try to parse invalid annotationsColin Walters2010-06-251-62/+87
| | | | | | | | | | | | | | | The old parser tried to parse: @foo: some text here (other text) Reject this. We strictly require another colon at the end to parse the text in between as (option) (other option). Futher ensure we only attempt to do option parse if we find something that matches the strict regexp ([A-Za-z]+). This could be tightened further. TODO: Have a warning for something that looks like an annotation, but isn't. https://bugzilla.gnome.org/show_bug.cgi?id=622659
* Allow attributes on parameters and return valuesDavid Zeuthen2010-06-241-0/+6
| | | | | | | | | | | | | | | | | | Any annotation where the key has a dot in the name will go into the attribute list. For example * @arg: (foo.bar baz): some arg the parameter @arg will get the attribute with key foo.bar and value baz. This also works for. * Returns: (foo.bar2 baz2): the return value Also add tests for this new feature. See https://bugzilla.gnome.org/show_bug.cgi?id=571548 Signed-off-by: David Zeuthen <davidz@redhat.com>
* [annotationparser] Reuse method for determining array typeJohan Dahlin2010-06-221-3/+1
|
* Apply annotations from invoker to vfuncColin Walters2010-06-161-1/+6
| | | | | | | | We typically expect people to annotate e.g. GList for virtuals on the invoker, not on the virtual slot, since the invoker feels like the public API. https://bugzilla.gnome.org/show_bug.cgi?id=621570
* Support the (transfer) annotation for properties.Tomeu Vizoso2010-06-081-2/+13
| | | | | | | | | | | | * girepository/*: Add g_property_info_get_ownership_transfer() and write the transfer attribute of properties into the typelib. * giscanner/*: Parse the (transfer) annotation and write it into the .gir. * tools/generate.c: Read the transfer annotation for properties and write to the .tgir. https://bugzilla.gnome.org/show_bug.cgi?id=620484
* Fix marshalling of GStrv.GOBJECT_INTROSPECTION_0_6_13Tomeu Vizoso2010-06-021-1/+5
| | | | | | | | | | | | | | | | | | * gir/gimarshallingtests.[hc]: Add a test for GStrv in function args and as struct fields. * girepository/giroffsets.c: Correctly compute the size of structs with array fields * girepository/girparser.c: Set is_pointer to FALSE for arrays with fixed size that are inside structs. * giscanner/glibtransformer.py: Special case GStrv as arrays of utf8. * giscanner/annotationparser.py: Make full transfer the default for arrays of char* returned by functions. https://bugzilla.gnome.org/show_bug.cgi?id=620170
* [giscanner] Parse multiline gtk-doc commentsJohan Dahlin2010-05-311-2/+10
|
* Add type annotation for propertiesJohan Dahlin2010-05-271-0/+4
| | | | | | | | | | Add type annotation syntax for GObject properties. This makes it possible to override the type of a property. For instance, this will allow function pointers with a G_TYPE_POINTER type set to be used from a language binding which reads the typelib information in addition g_object_class_find_property. https://bugzilla.gnome.org/show_bug.cgi?id=618318
* [scanner] Element-type annotation for GArray typesJohan Dahlin2010-05-271-4/+13
| | | | | | | Add support for (element-type) annotations for G*Array types. https://bugzilla.gnome.org/show_bug.cgi?id=619545
* [annotationparser] Avoid a couple of \Johan Dahlin2010-05-271-3/+3
|
* Support (out caller-allocates)Colin Walters2010-05-261-2/+22
| | | | | | | | | | | | | | | | | | | | | People have wanted support for marking (out) on functions of the form: /** * clutter_color_from_pixel: * @pixel: A pixel * @color: (out): Color to initialize with value of @pixel */ void clutter_color_from_pixel (guint32 pixel, ClutterColor *color); Where the caller is supposed to have allocated the argument; the C function just initializes it. This patch adds support for this argument passing style to introspection. In this case, we see the (out), and notice that there's only a single indirection (*) on the argument, and assume that this means (out caller-allocates). https://bugzilla.gnome.org/show_bug.cgi?id=604749
* Add support for the 'foreign' annotation to g-i-scannerGOBJECT_INTROSPECTION_0_6_12Tomeu Vizoso2010-05-231-0/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=619450
* Fix parameter ordering in error messageOwen W. Taylor2010-05-071-1/+1
| | | | | The function name and parameter name were backwards when warning about bad parameter references.
* Validate parameter referencesOwen W. Taylor2010-05-071-3/+20
| | | | | | | | | | | When an annotation references another parameter, check that that parameter actually exists. Add a comment to the handling of (closure) for callbacks to explain why we don't need the same handling there despite the use of get_parameter_index(). https://bugzilla.gnome.org/show_bug.cgi?id=617978
* Validate scope annotation valuesOwen W. Taylor2010-05-071-0/+10
| | | | | | | Make sure that the value specified for scope in a callback annotation is one of the legal values. https://bugzilla.gnome.org/show_bug.cgi?id=617978