From: Colin Walters Date: Mon, 15 Sep 2008 18:39:45 +0000 (+0000) Subject: Fix up deprecated parsing - this commit went missing X-Git-Tag: GOBJECT_INTROSPECTION_0_6_0~242 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f012c8a9c2468bf2bc63a39fed9bc787a6b667e;p=platform%2Fupstream%2Fgobject-introspection.git Fix up deprecated parsing - this commit went missing svn path=/trunk/; revision=606 --- diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l index 98e7c35a..9c370231 100644 --- a/giscanner/scannerlexer.l +++ b/giscanner/scannerlexer.l @@ -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 diff --git a/giscanner/transformer.py b/giscanner/transformer.py index b04efd39..4c2d467c 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -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):