summaryrefslogtreecommitdiff
path: root/tests/scanner
diff options
context:
space:
mode:
authorAndreas Rottmann <a.rottmann@gmx.at>2010-12-07 00:18:15 +0100
committerAndreas Rottmann <a.rottmann@gmx.at>2010-12-07 00:18:15 +0100
commitd85dbebee2c565a911c79dd199f0e70020f2918a (patch)
tree8e6c4f829c61b6d40647a53f1ed31bf2a81b1a81 /tests/scanner
parentf135e6f2f81e9dd52385cb1449779ef420c950c3 (diff)
downloadgobject-introspection-d85dbebee2c565a911c79dd199f0e70020f2918a.tar.gz
Support glib-mkenums comment /*< flags >*/
- 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>.
Diffstat (limited to 'tests/scanner')
-rw-r--r--tests/scanner/Annotation-1.0-expected.gir4
-rw-r--r--tests/scanner/annotation.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/scanner/Annotation-1.0-expected.gir b/tests/scanner/Annotation-1.0-expected.gir
index 6dcb23c3..330ad236 100644
--- a/tests/scanner/Annotation-1.0-expected.gir
+++ b/tests/scanner/Annotation-1.0-expected.gir
@@ -15,6 +15,10 @@ and/or use gtk-doc annotations. -->
shared-library="libannotation.so"
c:identifier-prefixes="Annotation"
c:symbol-prefixes="annotation">
+ <bitfield name="Bitfield" c:type="AnnotationBitfield">
+ <member name="foo" value="1" c:identifier="ANN_FLAG_FOO"/>
+ <member name="bar" value="2" c:identifier="ANN_FLAG_BAR"/>
+ </bitfield>
<callback name="Callback" c:type="AnnotationCallback">
<doc xml:whitespace="preserve">This is a callback.</doc>
<return-value transfer-ownership="none">
diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h
index e315af5b..b58aa814 100644
--- a/tests/scanner/annotation.h
+++ b/tests/scanner/annotation.h
@@ -3,6 +3,12 @@
#include <glib-object.h>
+typedef enum /*< flags,prefix=ANN >*/
+{
+ ANN_FLAG_FOO = 1,
+ ANN_FLAG_BAR = 2
+} AnnotationBitfield;
+
/**
* AnnotationCallback:
* @in: (in) (transfer none): array of ints