~zorba-coders/zorba/bug1123016

« back to all changes in this revision

Viewing changes to src/runtime/spec/iterator_h.xq

  • Committer: Sorin Marian Nasoi
  • Date: 2013-04-09 11:44:43 UTC
  • mfrom: (11301.1.53 zorba)
  • Revision ID: spungi@gmail.com-20130409114443-89vz57gpyjzwoiok
Merged lp:zorba trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
251
251
 
252
252
declare function local:add-methods ($iter) as xs:string?
253
253
{
254
 
  fn:concat("public:", $gen:newline,
255
 
    fn:string-join(
 
254
  fn:concat(
 
255
    "public:",
 
256
    $gen:newline,
 
257
    fn:string-join
 
258
    (
256
259
      for $method in $iter/zorba:method
257
 
      return fn:concat(
258
 
        $gen:indent,
259
 
        if ($method/@static eq "true")
260
 
        then
261
 
         "static "
262
 
        else
263
 
          "",
264
 
        $method/@return,
265
 
        " ",
266
 
        $method/@name,
267
 
        "(",
268
 
        local:get-method-arguments($method),
269
 
        ")",
270
 
        if ($method/@const eq "true") then
271
 
          " const;"
272
 
        else ";"), $gen:newline),
273
 
      $gen:newline)
 
260
      return fn:concat($gen:indent,
 
261
                       if ($method/@static eq "true") then "static " else "",
 
262
                       $method/@return,
 
263
                       " ",
 
264
                       $method/@name,
 
265
                       "(",
 
266
                       local:get-method-arguments($method),
 
267
                       ")",
 
268
                       if ($method/@const eq "true") then " const;" else ";"),
 
269
      $gen:newline
 
270
    ),
 
271
    $gen:newline
 
272
  )
274
273
};
275
274
 
276
275
 
277
276
declare function local:get-method-arguments($method) as xs:string?
278
277
{
279
 
  fn:string-join(
 
278
  fn:string-join
 
279
  (
280
280
    for $param in $method/zorba:param
281
 
    return fn:concat(
282
 
      $param/@type,
283
 
      " ",
284
 
      $param/@name),
285
 
    ", ")
 
281
    return fn:concat($param/@type, " ", $param/@name),
 
282
    ", "
 
283
  )
286
284
};
287
285
 
288
286