Fix up deprecated parsing - this commit went missing
authorColin Walters <walters@src.gnome.org>
Mon, 15 Sep 2008 18:39:45 +0000 (18:39 +0000)
committerColin Walters <walters@src.gnome.org>
Mon, 15 Sep 2008 18:39:45 +0000 (18:39 +0000)
svn path=/trunk/; revision=606

giscanner/scannerlexer.l
giscanner/transformer.py

index 98e7c35af76f9f0fc55f43c016f5730e44145ba7..9c3702315d41e7a52c0c034322823031f9fa7b12 100644 (file)
@@ -235,7 +235,7 @@ parse_gtkdoc (GISourceScanner *scanner,
   if (g_ascii_strcasecmp (parts[0], "eprecated") == 0)
     {
       if (n_parts == 3)
-       options = g_slist_prepend (options, g_strdup (parts[2]));
+       options = g_slist_prepend (options, g_strdup_printf ("%s: %s", parts[1], parts[2]));
       else if (n_parts == 2)
        options = g_slist_prepend (options, g_strdup (parts[1]));
       else
index b04efd391a350c9223dcc140dab421348e2c06c4..4c2d467ce78c224704a15d3eae10ceec2e6b5fb3 100644 (file)
@@ -215,24 +215,28 @@ class Transformer(object):
         return Member(symbol.ident, symbol.base_type.name,
                       symbol.ident)
 
-    def _create_function(self, symbol):
-        directives = symbol.directives()
-        parameters = list(self._create_parameters(
-            symbol.base_type, directives))
-        return_ = self._create_return(symbol.base_type.base_type,
-                                      directives.get('return', []))
-        name = self._strip_namespace_func(symbol.ident)
-        func = Function(name, return_, parameters, symbol.ident)
+    def _parse_deprecated(self, node, directives):
         deprecated = directives.get('deprecated', False)
         if deprecated:
             deprecated_value = deprecated[0]
+            print "DEPRECATED: %r" % (deprecated_value, )
             if ':' in deprecated_value:
                 # Split out gtk-doc version
-                (func.deprecated_version, func.deprecated) = \
+                (node.deprecated_version, node.deprecated) = \
                     [x.strip() for x in deprecated_value.split(':', 1)]
             else:
                 # No version, just include str
-                func.deprecated = deprecated_value.strip()
+                node.deprecated = deprecated_value.strip()
+
+    def _create_function(self, symbol):
+        directives = symbol.directives()
+        parameters = list(self._create_parameters(
+            symbol.base_type, directives))
+        return_ = self._create_return(symbol.base_type.base_type,
+                                      directives.get('return', []))
+        name = self._strip_namespace_func(symbol.ident)
+        func = Function(name, return_, parameters, symbol.ident)
+        self._parse_deprecated(func, directives)
         return func
 
     def _create_source_type(self, source_type):