devhelp r1152 - in trunk: . src



Author: rhult
Date: Mon Oct  6 17:11:33 2008
New Revision: 1152
URL: http://svn.gnome.org/viewvc/devhelp?rev=1152&view=rev

Log:
2008-10-06  Richard Hult  <richard imendio com>

	* src/dh-parser.c: (parser_start_node_keyword): Strip out "()" in
	addition to the previous " ()". Try to be smart for devhelp 1
	files by assuming it's a macro (might need to revert that part
	after testing more devhelp books).


Modified:
   trunk/ChangeLog
   trunk/src/dh-parser.c

Modified: trunk/src/dh-parser.c
==============================================================================
--- trunk/src/dh-parser.c	(original)
+++ trunk/src/dh-parser.c	Mon Oct  6 17:11:33 2008
@@ -306,6 +306,7 @@
                 link_type = DH_LINK_TYPE_KEYWORD;
         }
 
+        /* Strip out trailing " () or "()". */
         if (g_str_has_suffix (name, " ()")) {
                 tmp = g_strndup (name, strlen (name) - 3);
 
@@ -313,6 +314,17 @@
                         link_type = DH_LINK_TYPE_FUNCTION;
                 }
                 name = tmp;
+        }
+        else if (g_str_has_suffix (name, "()")) {
+                tmp = g_strndup (name, strlen (name) - 2);
+
+                /* With old devhelp format, take a guess that this is a
+                 * macro.
+                 */
+                if (link_type == DH_LINK_TYPE_KEYWORD) {
+                        link_type = DH_LINK_TYPE_MACRO;
+                }
+                name = tmp;
         } else {
                 tmp = NULL;
         }



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