~dpm/giraffe/seo-friendly-urls

« back to all changes in this revision

Viewing changes to giraffe/languages/C/__init__.py

  • Committer: Mikkel Kamstrup Erlandsen
  • Date: 2011-09-07 10:04:29 UTC
  • Revision ID: mikkel.kamstrup@gmail.com-20110907100429-cm91cnt52qifoi33
Add a "Constructors" section to C and Python docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
                w.end_div()
170
170
        
171
171
        #
 
172
        # Constructors
 
173
        #
 
174
        if cl.constructors :
 
175
                w.start_div(klass="methods")
 
176
                w.h4 ("Constructors")
 
177
        constructors = cl.constructors
 
178
        for ctor in constructors:
 
179
                params = param_list (ctor.parameters)
 
180
                
 
181
                retval = type_list ([cl])[0] + "*"
 
182
                
 
183
                w.start_div(klass="method constructor")
 
184
                w.start_p ()
 
185
                w.raw ('<span class="method-return-type">%s</span>' % retval)
 
186
                w.span(ctor.c_identifier, klass="method-name")
 
187
                w.start_span(klass="method-parameters")
 
188
                w.raw ("(" + ", ".join (params) + ")")
 
189
                w.end_span ()
 
190
                w.end_p()
 
191
                w.end_div()
 
192
        if cl.constructors:
 
193
                w.end_div()
 
194
        
 
195
        #
172
196
        # Methods
173
197
        #       
174
198
        if cl.methods :