gtk-doc r562 - in trunk: . tests/bugs/docs tests/bugs/src



Author: stefkost
Date: Mon May  5 10:57:00 2008
New Revision: 562
URL: http://svn.gnome.org/viewvc/gtk-doc?rev=562&view=rev

Log:
	* gtkdoc-mkdb.in:
	* tests/bugs/docs/tester-sections.txt:
	* tests/bugs/src/tester.h:
	  Don't expand '#' in ulink tags. Also allow to escape "#%@" with '\'.
	  Add to testsuite. Fixes #530758



Modified:
   trunk/ChangeLog
   trunk/gtkdoc-mkdb.in
   trunk/tests/bugs/docs/tester-sections.txt
   trunk/tests/bugs/src/tester.h

Modified: trunk/gtkdoc-mkdb.in
==============================================================================
--- trunk/gtkdoc-mkdb.in	(original)
+++ trunk/gtkdoc-mkdb.in	Mon May  5 10:57:00 2008
@@ -1966,8 +1966,10 @@
   $text =~ s%\|\[%<informalexample><programlisting>%g;
   $text =~ s%\]\|%</programlisting></informalexample>%g;
 
+  # keep CDATA unmodified, preserve ulink tags (ideally we preseve all tags
+  # as such)
   return &ModifyXMLElements ($text, $symbol,
-			     "<!\\[CDATA\\[|<programlisting[^>]*>",
+			     "<!\\[CDATA\\[|<ulink[^>]*>|<programlisting[^>]*>",
 			     \&ExpandAbbreviationsEndTag,
 			     \&ExpandAbbreviationsCallback);
 }
@@ -1975,10 +1977,12 @@
 
 # Returns the end tag corresponding to the given start tag.
 sub ExpandAbbreviationsEndTag {
-  if ($_[0] eq "<!\[CDATA\[") {
+  my ($start_tag) = @_;
+
+  if ($start_tag eq "<!\[CDATA\[") {
     return "]]>";
-  } else {
-    return "</programlisting>";
+  } elsif ($start_tag =~ m/<(\w+)/) {
+    return "</$1>";
   }
 }
 
@@ -2000,13 +2004,19 @@
     $text =~ s/(\w+)\s*\(\)/&MakeXRef($1, &tagify($1 . "()", "function"));/eg;
 
     # Convert '@param'
-    $text =~ s/\@(\w+((\.|->)\w+)*)/<parameter>$1<\/parameter>/g;
+    #$text =~ s/\@(\w+((\.|->)\w+)*)/<parameter>$1<\/parameter>/g;
+    $text =~ s/[^\\]\@(\w+((\.|->)\w+)*)/<parameter>$1<\/parameter>/g;
+    $text =~ s/\\\@(\w+((\.|->)\w+)*)/\ $1/g;
 
     # Convert '%constant'. Also allow negative numbers, e.g. %-1.
-    $text =~ s/\%(-?\w+)/&MakeXRef($1, &tagify($1, "literal"));/eg;
+    #$text =~ s/\%(-?\w+)/&MakeXRef($1, &tagify($1, "literal"));/eg;
+    $text =~ s/[^\\]\%(-?\w+)/&MakeXRef($1, &tagify($1, "literal"));/eg;
+    $text =~ s/\\\%(-?\w+)/\%$1/g;
 
     # Convert '#symbol'
-    $text =~ s/#([\w\-:]+)/&MakeHashXRef($1, "type");/eg;
+    #$text =~ s/#([\w\-:]+)/&MakeHashXRef($1, "type");/eg;
+    $text =~ s/[^\\]#([\w\-:]+)/&MakeHashXRef($1, "type");/eg;
+    $text =~ s/\\#([\w\-:]+)/#$1/g;
   }
 
   return $text;
@@ -2019,6 +2029,8 @@
   if ($tag eq "") {
     # We are inside a <programlisting> but outside any CDATA sections,
     # so we expand any gtk-doc abbreviations.
+    # FIXME: why is this different from &ExpandAbbreviationsCallback(),
+    #        why not just call it
     $text =~ s/#(\w+)/&MakeHashXRef($1, "");/eg;
   }
 
@@ -2082,13 +2094,14 @@
     my $result = "";
 
     while ($text =~ m/$start_tag_regexp/s) {
-      $before_tag = $`;
-      $start_tag = $&;
-      $text = $';
+      $before_tag = $`; # Prematch for last successful match string
+      $start_tag = $&;  # Last successful match
+      $text = $';       # Postmatch for last successful match string
 
       $result .= &$callback ($before_tag, $symbol, "");
       $result .= $start_tag;
 
+      # get the mathing end-tag for current tag
       $end_tag_regexp = &$end_tag_func ($start_tag);
 
       if ($text =~ m/$end_tag_regexp/s) {
@@ -3600,6 +3613,8 @@
                         } else {
                             $AllIncompleteSymbols{$symbol}=$tmpl_param_name;
                         }
+                        &LogWarning ($SourceSymbolSourceFile{$symbol}, $SourceSymbolSourceLine{$symbol},
+                            "$item description for $tmpl_param_name is missing in source code comment block.");
 #                        print <<EOF;
 #WARNING: $item description missing in source code comment block -
 # $type: $symbol $item: $tmpl_param_name.

Modified: trunk/tests/bugs/docs/tester-sections.txt
==============================================================================
--- trunk/tests/bugs/docs/tester-sections.txt	(original)
+++ trunk/tests/bugs/docs/tester-sections.txt	Mon May  5 10:57:00 2008
@@ -3,6 +3,9 @@
 <TITLE>GtkdocTester</TITLE>
 Bug446648
 Bug512154
+
+BUG_530758
+
 bug_141869_a
 bug_141869_b
 bug_324535

Modified: trunk/tests/bugs/src/tester.h
==============================================================================
--- trunk/tests/bugs/src/tester.h	(original)
+++ trunk/tests/bugs/src/tester.h	Mon May  5 10:57:00 2008
@@ -109,5 +109,14 @@
   unsigned long index;
 } Bug512154;
 
+/**
+ * BUG_530758:
+ *
+ * <![CDATA[http://bugzilla.gnome.org/show_bug.cgi?id=530758#c1]]>
+ * 
+ * <ulink url="http://bugzilla.gnome.org/show_bug.cgi?id=530758#c1";>Test</ulink>
+ */
+#define BUG_530758 "dummy"
+
 #endif // GTKDOC_TESTER_H
 



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