diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-02-01 20:01:39 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-02-01 20:07:52 -0500 |
commit | 54734b195dda07a935470b64e0654101f5528b94 (patch) | |
tree | 95abc2ecdca42e087e735a3c83675993e05686cb /giscanner/ast.py | |
parent | fb550201b36b49035d11a7d25b93d2191b6481f8 (diff) | |
download | gobject-introspection-54734b195dda07a935470b64e0654101f5528b94.tar.gz |
ast: Add a new all_parameters property to Callable
This will be used by the doctool to show the self parameter in C
and Python docs.
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r-- | giscanner/ast.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index 18313320..3092d67a 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -582,6 +582,14 @@ class Callable(Node): self.instance_parameter = None # Parameter self.parent = None # A Class or Interface + # Returns all parameters, including the instance parameter + @property + def all_parameters(self): + if self.instance_parameter is not None: + return [self.instance_parameter] + self.parameters + else: + return self.parameters + def get_parameter_index(self, name): for i, parameter in enumerate(self.parameters): if parameter.argname == name: |