diff options
author | Andreas Rottmann <a.rottmann@gmx.at> | 2009-03-23 22:19:24 (GMT) |
---|---|---|
committer | Andreas Rottmann <a.rottmann@gmx.at> | 2009-03-23 22:19:24 (GMT) |
commit | cf7621f31c6b3eaf29e1da82631a9404f8b1c036 (patch) | |
tree | 21501ed5345aa84b289046927632531d23135f6f /giscanner/ast.py | |
parent | bec176d20df2f0e25a0f3dc84a3dbe3edeecd65f (diff) |
Bug 574284 - Add support for a 'closure' and 'destroy' annotations
This allows to annotate cases where the heuristics don't work.
TODO: According to Juerbi, there are cases where two callbacks refer
to the same user_data, which is prohibited by the current
implementation.
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r-- | giscanner/ast.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index 0d3f0bb..b0db6e2 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -521,6 +521,16 @@ class Callback(Node): self.throws = False self.doc = None + def get_parameter_index(self, name): + for i, parameter in enumerate(self.parameters): + if parameter.name == name: + return i + + def get_parameter(self, name): + for parameter in self.parameters: + if parameter.name == name: + return parameter + def __repr__(self): return 'Callback(%r, %r, %r)' % ( self.name, self.retval, self.parameters) |