[gtk-doc] annotations: allow '=' to be used in annotations



commit 4512111ad115e3b125818dba6249cc8329d72d3f
Author: Stefan Sauer <ensonic users sf net>
Date:   Mon Sep 19 16:05:01 2016 +0200

    annotations: allow '=' to be used in annotations
    
    The online docs seem to have added a key=value form.
    Fixes #771255

 gtkdoc-mkdb.in                             |    3 ++-
 tests/annotations/docs/tester-sections.txt |    1 +
 tests/annotations/src/tester.c             |   10 ++++++++++
 tests/annotations/src/tester.h             |    1 +
 4 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 6ee0eba..5cce362 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -152,6 +152,7 @@ my %PreProcessorDirectives = (
 # remember used annotation (to write minimal glossary)
 my %AnnotationsUsed;
 
+# the regexp that parses the annotation is in ScanSourceFile()
 my %AnnotationDefinition = (
     # the GObjectIntrospection annotations are defined at:
     # https://live.gnome.org/GObjectIntrospection/Annotations
@@ -4330,7 +4331,7 @@ sub ScanSourceFile {
             } elsif (m%^\s*(PROGRAM:\s*\S+)%) {
                 $symbol = $1;
                 @TRACE@("PROGRAM DOCS found in source for : '$symbol'\n");
-            } elsif (m%^\s*([\w:-]*\w)\s*:?\s*(\([-A-Za-z0-9._() ]+?\)\s*)*$%) {
+            } elsif (m%^\s*([\w:-]*\w)\s*:?\s*(\([-A-Za-z0-9._()= ]+?\)\s*)*$%) {
                 $symbol = $1;
                 my $annotation = $2;
                 @TRACE@("SYMBOL DOCS found in source for : '$symbol'\n");
diff --git a/tests/annotations/docs/tester-sections.txt b/tests/annotations/docs/tester-sections.txt
index ff7ef70..d7c1c38 100644
--- a/tests/annotations/docs/tester-sections.txt
+++ b/tests/annotations/docs/tester-sections.txt
@@ -20,6 +20,7 @@ annotation_skip_return
 annotation_scope
 annotation_rename_to
 annotation_attributes_single
+annotation_attributes_single_eq
 stability_unstable
 annotation_multiline_on_function
 annotation_multiline_on_function2
diff --git a/tests/annotations/src/tester.c b/tests/annotations/src/tester.c
index 4a8d23b..eeb1159 100644
--- a/tests/annotations/src/tester.c
+++ b/tests/annotations/src/tester.c
@@ -268,6 +268,16 @@ annotation_attributes_single (void)
 }
 
 /**
+ * annotation_attributes_single_eq: (attributes key=value)
+ *
+ * Documentation for this function.
+ */
+void
+annotation_attributes_single_eq (void)
+{
+}
+
+/**
  * stability_unstable:
  *
  * An experimental function.
diff --git a/tests/annotations/src/tester.h b/tests/annotations/src/tester.h
index 2269c7a..e3b0f78 100644
--- a/tests/annotations/src/tester.h
+++ b/tests/annotations/src/tester.h
@@ -39,6 +39,7 @@ void annotation_scope (GCallback *callback, gpointer user_data);
 void annotation_rename_to (void);
 
 void annotation_attributes_single (void);
+void annotation_attributes_single_eq (void);
 
 void stability_unstable(void);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]