summaryrefslogtreecommitdiff
path: root/giscanner/ast.py
diff options
context:
space:
mode:
authorTorsten Schönfeld <kaffeetisch@gmx.de>2011-08-13 12:00:00 +0200
committerTorsten Schönfeld <kaffeetisch@gmx.de>2011-08-13 14:59:24 +0200
commitc47a10f867da52695a5c5b5bf7e0a22dddc0b085 (patch)
tree21ad6c167d702881598c6edb577f47acfd6d287b /giscanner/ast.py
parentd437ae4ae95bada1305c6b720bb7eb207c7122bf (diff)
downloadgobject-introspection-c47a10f867da52695a5c5b5bf7e0a22dddc0b085.tar.gz
scanner: handle static methods on all types
Instead of just handling static methods for classes, handle them for: - Records and boxed - Unions - Interfaces Based on a patch by Owen Taylor. https://bugzilla.gnome.org/show_bug.cgi?id=572408
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r--giscanner/ast.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index bd56aef3..8ca3a4dd 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -19,6 +19,8 @@
# Boston, MA 02111-1307, USA.
#
+import copy
+
from .message import Position
from .odict import odict
from .utils import to_underscores
@@ -568,6 +570,13 @@ class Function(Callable):
self.shadowed_by = None # C symbol string
self.shadows = None # C symbol string
+ def clone(self):
+ clone = copy.copy(self)
+ # copy the parameters array so a change to self.parameters does not
+ # influence clone.parameters.
+ clone.parameters = self.parameters[:]
+ return clone
+
class ErrorQuarkFunction(Function):