~juan457/+junk/zorba

« back to all changes in this revision

Viewing changes to src/runtime/spec/codegen-cpp.xq

  • Committer: Markos Zaharioudakis
  • Date: 2012-07-11 15:38:39 UTC
  • mfrom: (10924 zorba)
  • mto: This revision was merged to the branch mainline in revision 10932.
  • Revision ID: markos_za@yahoo.com-20120711153839-0mkh15cg2ubknchd
work in progress

Show diffs side-by-side

added added

removed removed

Lines of Context:
321
321
                string-join ((
322
322
                  for $param at $i in $sig/zorba:param
323
323
                  return
324
 
                    concat(
 
324
                    let $line := concat(
325
325
                      local:create-zorba-type($param, $mapping),
326
326
                      if ($i <= count($sig/zorba:param))
327
327
                      then
329
329
                      else
330
330
                        '',
331
331
                      $gen:newline, gen:indent(4)
332
 
                    ),
333
 
                  local:create-zorba-type($sig/zorba:output, $mapping)
 
332
                      )
 
333
                    return if (contains($line, "STRUCTURED_ITEM"))
 
334
                           then ($gen:newline, "#ifdef ZORBA_WITH_JSON", $gen:newline, gen:indent(4), $line , $gen:newline, "#else", $gen:newline, gen:indent(4), replace($line, "STRUCTURED_ITEM", "ANY_NODE"), $gen:newline, "#endif", $gen:newline, gen:indent(4))
 
335
                           else $line,
 
336
                  let $line := local:create-zorba-type($sig/zorba:output, $mapping)
 
337
                  return if (contains($line, "STRUCTURED_ITEM"))
 
338
                         then ($gen:newline, "#ifdef ZORBA_WITH_JSON", $gen:newline, gen:indent(4), $line, $gen:newline, "#else", $gen:newline, gen:indent(4), replace($line, "STRUCTURED_ITEM", "ANY_NODE"), $gen:newline, "#endif", $gen:newline, gen:indent(4))
 
339
                         else $line
334
340
                ), ''),
335
341
              '),', $gen:newline, gen:indent(4), 
336
342
              'FunctionConsts::', gen:function-kind($sig) ,');',