summaryrefslogtreecommitdiff
path: root/tests/scanner/annotation.h
Commit message (Collapse)AuthorAgeFilesLines
* tests: Move Annotation into RegressJasper St. Pierre2013-02-071-76/+76
| | | | | | | The goal here is to have one master library for testing lots of edge cases for GIRs rather than lots of individual libraries. https://bugzilla.gnome.org/show_bug.cgi?id=693097
* giscanner: Apply standard annotations to constant valuesJasper St. Pierre2013-02-011-0/+2
| | | | | | | | | | While there's no particular reason I need to do this, there really isn't any reason to not do this, and it helps with doctool or whatever in the future if we want to document when a constant showed up. g-ir-compiler also keeps track of constant deprecations, so this fixes constants not ever being deprecated. https://bugzilla.gnome.org/show_bug.cgi?id=693040
* Add a floating alias for noneJohan Dahlin2011-11-251-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=657202
* Add constant value annotationJohan Dahlin2011-09-141-0/+21
| | | | | Add an annotation tag "Value:" which can be used on constants to override the value.
* Try harder to preserve c:typeJohan Dahlin2011-08-131-0/+1
| | | | | When we replace a type using annotation we should keep the ctype of the original type.
* scanner: avoid crash when annotation explicitly changes 'self' argumentPavel Holejsovsky2010-12-211-0/+1
|
* Support glib-mkenums comment /*< flags >*/Andreas Rottmann2010-12-071-0/+6
| | | | | | | | | | | | | | | - Modify the lexer to consider all "trigraph" comments specially, and parse them for "flags" as well as "private" and "public" (which were previously hardcoded). This change allows for future support of multiple annotations inside a single trigraph comment. - Change the parser to consider the additional field "flags" set by the lexer when constructing enums. - Add a test case for the "flags" trigraph comment to the scanner annotation tests. See <https://bugzilla.gnome.org/show_bug.cgi?id=631530>.
* Accept trailing whitespace at the start of a comment blockColin Walters2010-10-191-0/+3
| | | | | | Might as well be liberal here, as long as we have a test case. https://bugzilla.gnome.org/show_bug.cgi?id=631690
* Revert "Apply `(type bitfield)' annotations for enums"Johan Dahlin2010-10-061-9/+0
| | | | This reverts commit d15e386c8e10dd6b645a444e29cc053100089a07.
* Apply `(type bitfield)' annotations for enumsAndreas Rottmann2010-10-051-0/+9
| | | | Previously, such annotations would be ignored.
* annotationparser: Don't ignore annotations if there's a : in docsGOBJECT_INTROSPECTION_0_9_8Colin Walters2010-09-281-0/+2
| | | | | | | | 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] Allow param less closuresJohan Dahlin2010-09-241-1/+1
| | | | | Allow closures without annotations to avoid having to duplicate the parameter name.
* Fix a couple of broken annotationsJohan Dahlin2010-09-241-1/+1
|
* Clean up annotation parsing, don't try to parse invalid annotationsColin Walters2010-06-251-0/+2
| | | | | | | | | | | | | | | 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/+3
| | | | | | | | | | | | | | | | | | 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>
* [scanner] Element-type annotation for GArray typesJohan Dahlin2010-05-271-0/+3
| | | | | | | Add support for (element-type) annotations for G*Array types. https://bugzilla.gnome.org/show_bug.cgi?id=619545
* Bug 579008 - Don't override element-type for arraysColin Walters2009-06-231-0/+2
| | | | | | | Annotation parser patch from: Tim Horton <hortont424@gmail.com> If an explicit element type is specified, don't override it with guint8.
* Bug 574284 - Add support for a 'closure' and 'destroy' annotationsAndreas Rottmann2009-03-231-0/+12
| | | | | | | | | | This allows to annotate cases where the heuristics don't work. TODO: According to Juerbi, there are cases where two callbacks refer to the same user_data, which is prohibited by the current implementation. Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Bug 556475 – support Shadows: annotationAndreas Rottmann2009-03-191-0/+7
| | | | Add support for the 'Rename To:' annotation for functions and methods.
* Bug 565147 - Add (type) annotation to override the C type definitionColin Walters2009-03-161-0/+3
| | | | | | We previously supported (type) on signals only, extend it to all cases. This is useful for a few cases where libraries use a superclass like GtkWidget* for C convenience, where the actual type is a subclass.
* Bug 571548 - Generic attributesColin Walters2009-03-031-0/+4
| | | | | | | | We now support an extensible mechanism where arbitrary key-value pairs may be associated with almost all items, including objects, methods, and properties. These attributes appear in both the .gir and the .typelib.
* Misc warning fixesDan Winship2009-01-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | * giscanner/scannerparser.y: Fix the "Ignoring non-UTF-8 constant string" error to print the right value. * tests/scanner/annotation.c (backslash_parsing_tester) (backslash_parsing_tester_2): make these non-static to avoid a warning. (annotation_object_string_out) (annotation_string_zero_terminated): fix return values * tests/scanner/annotation.h (annotation_object_with_voidp): prototype this * tests/scanner/gtkfrob.c: * tests/scanner/gtkfrob.h (gtk_frob_language_manager_get_default): fix prototype. (s/()/(void)/). * tools/compiler.c (format_output): fix signed/unsigned warning. Output a prototype for register_typelib() to avoid warnings later. svn path=/trunk/; revision=1071
* Add a few more test-casesJohan Dahlin2009-01-141-0/+2
| | | | svn path=/trunk/; revision=1038
* Bug 555036 – put gtk-doc in GIRJohan Dahlin2009-01-131-1/+13
| | | | | | | | | | | | | | | | | 2009-01-13 Johan Dahlin <jdahlin@async.com.br> Bug 555036 – put gtk-doc in GIR * giscanner/annotationparser.py: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/glibast.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation.h: * tests/scanner/foo-1.0-expected.gir: svn path=/trunk/; revision=1032
* Bug 566419 – Element type of arrays not properly handled in all casesJohan Dahlin2009-01-121-0/+10
| | | | | | | | | | | | | | | | | | 2009-01-12 Johan Dahlin <jdahlin@async.com.br> Bug 566419 – Element type of arrays not properly handled in all cases * giscanner/annotationparser.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/annotation.c (annotation_object_set_data), (annotation_object_set_data2), (annotation_object_set_data3): * tests/scanner/annotation.h: Based on patch by Andreas Rottmann svn path=/trunk/; revision=1019
* Bug 563794 - Redo annotation parsing & applyingJohan Dahlin2009-01-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-01-12 Johan Dahlin <jdahlin@async.com.br> Bug 563794 - Redo annotation parsing & applying Thanks to Colin for helping out considerably in landing this. * giscanner/Makefile.am: * giscanner/ast.py: * giscanner/dumper.py: * giscanner/girparser.py: * giscanner/giscannermodule.c (pygi_source_scanner_get_comments), (calc_attrs_length), (pygi_collect_attributes), (init_giscanner): * giscanner/glibtransformer.py: * giscanner/scannerlexer.l: * giscanner/sourcescanner.c (gi_source_symbol_unref), (gi_source_scanner_new), (gi_source_scanner_free), (gi_source_scanner_get_comments): * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/transformer.py: * giscanner/xmlwriter.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/annotation.c: * tests/scanner/annotation.h: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: * tools/g-ir-scanner: This commit merges the annotation parser rewrite branch. It'll change the annotation parsing to be done completely in python code which will make it easier to do further annotation parsing easier. svn path=/trunk/; revision=1017
* Bug 556489 – callback annotationsAndreas Rottmann2009-01-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-01-03 Andreas Rottmann <a.rottmann@gmx.at> Bug 556489 – callback annotations * giscanner/transformer.py * tools/generate.c (write_callable_info): Write out the new scope, closure and destroy attributes. * giscanner/transformer.py (Transformer._type_is_callback): New method, checking if a given type is a callback. (Transformer._augment_callback_params): New method; adds information (closure, destroy) to callback parameters. (Transformer._handle_closure, Transformer._handle_destroy): New methods, auxiliary to _augment_callback_params. (Transformer._create_function): Call _augment_callback_params(). (Transformer._create_parameter): Handle scope option. (Transformer._create_typedef_callback): New method, creates a callback, and registers it in the typedef namespace (Transformer._create_typedef): Use _create_typedef_callback() instead of the plain _create_callback(). * giscanner/ast.py (Parameter): Added callback-related fields. * giscanner/girwriter.py: Write out new Parameter fields. * girepository/girnode.h (GIrNodeParam): Added fields scope, closure and destroy. * girepository/gtypelib.h (ArgBlob): Ditto. * girepository/girparser.c (start_parameter): Handle new fields. * girepository/girmodule.c (g_ir_module_build_typelib): Adjust arg_blob_size, bump major version due to this change. * girepository/girnode.c (g_ir_node_get_full_size_internal) (g_ir_node_build_typelib) * girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size adjustments. (g_ir_node_build_typelib): Fill in new ArgBlob flags from param. * girepository/girepository.h (GIScope): New enumeration, listing the different possible scopes for callbacks. * girepository/ginfo.c (g_arg_info_get_scope) (g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for callback-related argument indices (callback scope, closure for a callback, destroy notification for a callback). * tests/scanner/: Added testcases for new features. svn path=/trunk/; revision=998
* Disable array auto-detection for out-annotated parametersOwen Taylor2008-12-161-0/+2
| | | | | | | | | | | | | | | | If we have a parameter annotated as (out), then having a ctype of 'char **' (or similar) doesn't necessarily indicate an array. * giscanner/transformer.py: Skip array-detection logic for (out)-annotated parameters. * tests/scanner/annotation.h tests/scanner/annotation.c tests/scanner/annotation-1.0-expected.gir tests/scanner/annotation-1.0-expected.tgir: Add a test for an (out) string parameter. http://bugzilla.gnome.org/show_bug.cgi?id=563934 svn path=/trunk/; revision=994
* Bug 563742 – introspection should record the introduced version ofTristan Van Berkom2008-12-091-3/+4
| | | | | | | | | | | | | | | | | | | | | 2008-12-08 Tristan Van Berkom <tristan.van.berkom@gmail.com> Bug 563742 – introspection should record the introduced version of symbols marked with the "Since:" tag reviewed by: Johan * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/scannerlexer.l: * giscanner/transformer.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/annotation.c (annotation_versioned): * tests/scanner/annotation.h: svn path=/trunk/; revision=988
* Bug 561617 – Return value array annotationsJohan Dahlin2008-11-211-0/+1
| | | | | | | | | | | | | | 2008-11-21 Johan Dahlin <jdahlin@async.com.br> Bug 561617 – Return value array annotations * giscanner/transformer.py: * tests/scanner/annotation.c (annotation_return_array): * tests/scanner/annotation.h: Add support for (array) for return value annotations as well. svn path=/trunk/; revision=957
* fix spelling of GHashTable. #561135Dan Winship2008-11-171-0/+1
| | | | | | | | | | | | * giscanner/glibtransformer.py (GLibTransformer.__init__): fix spelling of GHashTable. #561135 * tests/scanner/annotation.c (annotation_object_get_hash): * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: add a test of GHashTable annotations svn path=/trunk/; revision=940
* Bug 552568 - All the argv parameters in Gtk.gir map char*** to int8Colin Walters2008-11-171-0/+5
| | | | svn path=/trunk/; revision=939
* Bug 560708 – Fix zero-termination defaults for arrays with length=Colin Walters2008-11-131-0/+3
| | | | svn path=/trunk/; revision=921
* Bug 558436 - avoid having scanner load app codeColin Walters2008-11-131-1/+1
| | | | svn path=/trunk/; revision=912
* Bug 557092 – Callback annotations not usedTommi Komulainen2008-10-221-0/+16
| | | | | | | | | | | 2008-10-22 Tommi Komulainen <tommi.komulainen@iki.fi> * giscanner/transformer.py (_create_callback): use annotations for callbacks * tests/scanner/annotation.h * tests/scanner/annotation-1.0-expected.gir: add tests svn path=/trunk/; revision=781
* Default GObject transfer to fullColin Walters2008-10-161-0/+1
| | | | svn path=/trunk/; revision=732
* Add missing annotation_object_get_type, fix up expected GIRColin Walters2008-10-041-0/+2
| | | | svn path=/trunk/; revision=658
* Write out list and map types, parse 'array' annotationColin Walters2008-09-291-1/+4
| | | | svn path=/trunk/; revision=634
* Some work on arraysColin Walters2008-09-291-3/+10
| | | | svn path=/trunk/; revision=633
* Bug 552065: Add deprecation information to GIRColin Walters2008-09-151-0/+3
| | | | | | | | | | | | | * giscanner/ast.py: Add deprecation attributes. * giscanner/girwriter.py: Write out deprecation data. * girepository/girparser.c: Relax parsing; deprecated attribute now includes freeform string. * giscanner/scannerlexer.l: Parse Deprecated. * giscanner/transformer.py: Look for deprecated attribute on functions. * tests/scanner/*: Add a Deprecated test. svn path=/trunk/; revision=603
* Split out annotation tests out of fooJohan Dahlin2008-08-201-0/+41
2008-08-20 Johan Dahlin <johan@gnome.org> * tests/scanner/Makefile.am: * tests/scanner/annotation-expected.gir: * tests/scanner/annotation.c (annotation_object_class_init), (annotation_object_init), (annotation_object_method), (annotation_object_in), (annotation_object_out), (annotation_object_inout), (annotation_object_inout2), (annotation_object_inout3), (annotation_object_calleeowns), (annotation_object_calleesowns), (annotation_object_get_strings), (annotation_object_with_voidp), (annotation_object_get_objects), (annotation_object_create_object), (annotation_object_allow_none): * tests/scanner/annotation.h: * tests/scanner/foo-expected.gir: * tests/scanner/foo.c: * tests/scanner/foo.h: Split out annotation tests out of foo svn path=/trunk/; revision=410