[gobject-introspection] ast: Allow lookup of the instance parameter by name



commit d1ac20f7920e788face9c8d32bd554287d7861da
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Feb 1 20:10:06 2013 -0500

    ast: Allow lookup of the instance parameter by name
    
    This will be used by the doctool to properly identify the
    instance parameter.

 giscanner/ast.py                                   |    2 +-
 .../DocExamples.Obj.method.page                    |    3 ++-
 .../DocExamples.Obj.method.page                    |    3 ++-
 .../DocExamples.Obj.method.page                    |    3 ++-
 tests/doctool/doc-examples-obj.c                   |    3 ++-
 5 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/giscanner/ast.py b/giscanner/ast.py
index 3092d67..aae9ee2 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -597,7 +597,7 @@ class Callable(Node):
         raise ValueError("Unknown argument %s" % (name, ))
 
     def get_parameter(self, name):
-        for parameter in self.parameters:
+        for parameter in self.all_parameters:
             if parameter.argname == name:
                 return parameter
         raise ValueError("Unknown argument %s" % (name, ))
diff --git a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
index 54d59f1..d1be796 100644
--- a/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
+++ b/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page
@@ -53,7 +53,8 @@ gint first_arg,
 
   
     <p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj"/> that was
-created with <link xref="DocExamples.Obj.new"/>.</p><p>This should be a %FALSEALARM.</p>
+created with <link xref="DocExamples.Obj.new"/>, by passing it
+in as <code>self</code>.</p><p>This should be a %FALSEALARM.</p>
   
   
     <p>Since 0.99</p>
diff --git a/tests/doctool/DocExamples-1.0-Gjs-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-Gjs-expected/DocExamples.Obj.method.page
index 7d474ec..9eae46c 100644
--- a/tests/doctool/DocExamples-1.0-Gjs-expected/DocExamples.Obj.method.page
+++ b/tests/doctool/DocExamples-1.0-Gjs-expected/DocExamples.Obj.method.page
@@ -50,7 +50,8 @@ function method(first_arg:Number, second_arg:Number, boolean_arg:Boolean, pointe
 
   
     <p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj"/> that was
-created with <link xref="DocExamples.Obj.new"/>.</p><p>This should be a %FALSEALARM.</p>
+created with <link xref="DocExamples.Obj.new"/>, by passing it
+in as <code>self</code>.</p><p>This should be a %FALSEALARM.</p>
   
   
     <p>Since 0.99</p>
diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
index c190090..050d7b3 100644
--- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
+++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page
@@ -51,7 +51,8 @@ def method(self, first_arg, second_arg, boolean_arg, pointer_arg, string):
 
   
     <p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj"/> that was
-created with <link xref="DocExamples.Obj.new"/>.</p><p>This should be a %FALSEALARM.</p>
+created with <link xref="DocExamples.Obj.new"/>, by passing it
+in as <code>self</code>.</p><p>This should be a %FALSEALARM.</p>
   
   
     <p>Since 0.99</p>
diff --git a/tests/doctool/doc-examples-obj.c b/tests/doctool/doc-examples-obj.c
index bd13481..3b57110 100644
--- a/tests/doctool/doc-examples-obj.c
+++ b/tests/doctool/doc-examples-obj.c
@@ -116,7 +116,8 @@ doc_examples_obj_new (void)
  * This is an example of how to document a method.
  *
  * You should call this on a #DocExamplesObj that was
- * created with doc_examples_obj_new().
+ * created with doc_examples_obj_new(), by passing it
+ * in as @self.
  *
  * This should be a %FALSEALARM.
  *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]