Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch 
into lp:zorba.

Commit message:
changed some scripting tests to cmply with the current syntax of the scripting 
spec.

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/130422

changed some scripting tests to cmply with the current syntax of the scripting 
spec.
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/130422
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-10-12 10:46:46 +0000
+++ ChangeLog	2012-10-18 20:10:32 +0000
@@ -13,6 +13,7 @@
     position that is negative)
   * Fixed bug #1061222 (bad message for errors in index key type declaration)
   * Fixed bug #1065175 (preceding::node()[1] returns wrong results)
+  * Fixed bug #1065321 (following:text() doesn't return results in doc order)
   * Fixed bug #1021492 (while computeing the "sources" of a prolog var, skip
     any var-setting exprs that appear in non-used (and non-optimized) functions). 
 

=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc.xq'
--- modules/com/zorba-xquery/www/modules/xqdoc.xq	2012-10-08 12:09:36 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc.xq	2012-10-18 20:10:32 +0000
@@ -139,6 +139,7 @@
   $filename as xs:string
 ) as element() external;
 
+
 (:~
  : Generated the an XQDoc XML document for the module provided
  : as parameter to this function.
@@ -157,6 +158,7 @@
   xqd:xqdoc-content-impl($module, "")
 };
 
+
 (:~
  : Generated the an XQDoc XML document for the module provided
  : as parameter to this function.

=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq'
--- modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq	2012-09-19 21:16:15 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq	2012-10-18 20:10:32 +0000
@@ -278,6 +278,8 @@
       xqdoc2html:copy-files($xhtmlRequisitesPath, $cssPath    ,"css");
 
       file:create-directory($schemasPath);
+
+      ()
     }
 };
 
@@ -693,11 +695,11 @@
       fn:not(fn:matches($exampleSource, $search-queries))) then
     file:write( $exampleDestination,
                 xqdoc2html:create-xhtml-wrapper($exampleContent,"xquery"),
-                $xqdoc2html:serParamXhtml)
+                $xqdoc2html:serParamXhtml);
   else if (fn:matches($exampleContent, "output", "i")) then
     file:write( $exampleDestination,
                 xqdoc2html:create-xhtml-wrapper($exampleContent,"xquery"),
-                $xqdoc2html:serParamXhtml)
+                $xqdoc2html:serParamXhtml);
   else
     let $specSource := fn:replace($exampleSource, "[.]xq$", ".spec")
     return

=== modified file 'src/compiler/expression/expr_type.cpp'
--- src/compiler/expression/expr_type.cpp	2012-10-08 12:09:36 +0000
+++ src/compiler/expression/expr_type.cpp	2012-10-18 20:10:32 +0000
@@ -316,60 +316,14 @@
   {
     fo_expr* e = static_cast<fo_expr*>(this);
 
-    const function* func = e->get_func();
     /*
       const user_function* udf = dynamic_cast<const user_function*>(func);
 
       if (udf != NULL)
       return udf->getUDFReturnType(sctx);
     */
-    FunctionConsts::FunctionKind funcKind = func->getKind();
-
-    switch (funcKind)
-    {
-    case FunctionConsts::STATIC_COLLECTIONS_DML_COLLECTION_1:
-    {
-      const store::Item* qname = e->theArgs[0]->getQName(theSctx);
-
-      if (qname != NULL)
-      {
-        const StaticallyKnownCollection* collection = theSctx->lookup_collection(qname);
-        if (collection != NULL)
-        {
-          newType = collection->getCollectionType();
-        }
-        else
-        {
-          RAISE_ERROR(zerr::ZDDY0001_COLLECTION_NOT_DECLARED, get_loc(),
-          ERROR_PARAMS(qname->getStringValue()));
-        }
-      }
-      break;
-    }
-    case FunctionConsts::FN_SUBSEQUENCE_3:
-    {
-      const_expr* lenExpr = dynamic_cast<const_expr*>(e->theArgs[2]);
-
-      if (lenExpr != NULL)
-      {
-        store::Item* val = lenExpr->get_val();
-        xs_double len = val->getDoubleValue();
-        if (len == 1.0)
-        {
-          newType = tm->create_type(*e->theArgs[0]->get_return_type(),
-                                    TypeConstants::QUANT_QUESTION);
-        }
-      }
-      break;
-    }
-    default:
-      break;
-    }
-
-    if (newType == NULL)
-    {
-      newType = e->theFunction->getReturnType(e);
-    }
+
+    newType = e->theFunction->getReturnType(e);
 
     break;
   }

=== modified file 'src/compiler/expression/flwor_expr.h'
--- src/compiler/expression/flwor_expr.h	2012-10-09 14:06:08 +0000
+++ src/compiler/expression/flwor_expr.h	2012-10-18 20:10:32 +0000
@@ -45,6 +45,7 @@
 ********************************************************************************/
 class flwor_clause
 {
+  friend class expr;
   friend class flwor_expr;
   friend class ExprIterator;
   friend class ExprManager;
@@ -139,6 +140,7 @@
 ********************************************************************************/
 class forletwin_clause : public flwor_clause
 {
+  friend class expr;
   friend class flwor_expr;
   friend class ExprManager;
   friend class ExprIterator;
@@ -221,6 +223,7 @@
 ********************************************************************************/
 class let_clause : public forletwin_clause
 {
+  friend class expr;
   friend class flwor_expr;
   friend class ExprManager;
   friend class ExprIterator;
@@ -263,6 +266,7 @@
 ********************************************************************************/
 class window_clause : public forletwin_clause
 {
+  friend class expr;
   friend class flwor_expr;
   friend class ExprManager;
   friend class ExprIterator;
@@ -343,6 +347,7 @@
 ********************************************************************************/
 class flwor_wincond
 {
+  friend class expr;
   friend class flwor_expr;
   friend class ExprManager;
   friend class ExprIterator;
@@ -436,6 +441,7 @@
 ********************************************************************************/
 class group_clause : public flwor_clause
 {
+  friend class expr;
   friend class flwor_expr;
   friend class ExprManager;
   friend class ExprIterator;
@@ -514,6 +520,7 @@
 ********************************************************************************/
 class orderby_clause : public flwor_clause
 {
+  friend class expr;
   friend class ExprIterator;
   friend class ExprManager;
   friend class flwor_expr;

=== modified file 'src/compiler/expression/ft_expr.cpp'
--- src/compiler/expression/ft_expr.cpp	2012-10-09 14:06:08 +0000
+++ src/compiler/expression/ft_expr.cpp	2012-10-18 20:10:32 +0000
@@ -71,5 +71,11 @@
 }
 
 
+ftnode_t ftcontains_expr::get_ftselection() const
+{
+  return ftselection_;
+}
+
+
 } // namespace zorba
 /* vim:set et sw=2 ts=2: */

=== modified file 'src/compiler/expression/ft_expr.h'
--- src/compiler/expression/ft_expr.h	2012-10-09 14:06:08 +0000
+++ src/compiler/expression/ft_expr.h	2012-10-18 20:10:32 +0000
@@ -48,7 +48,7 @@
   void compute_scripting_kind();
 
   expr* get_range() const { return range_; }
-  ftnode_t get_ftselection() const { return ftselection_; }
+  ftnode_t get_ftselection() const;
   expr* get_ignore() const { return ftignore_; }
 
   void accept( expr_visitor& );

=== modified file 'src/compiler/rewriter/rules/nodeid_rules.cpp'
--- src/compiler/rewriter/rules/nodeid_rules.cpp	2012-10-15 13:35:59 +0000
+++ src/compiler/rewriter/rules/nodeid_rules.cpp	2012-10-18 20:10:32 +0000
@@ -792,9 +792,6 @@
             std::vector<fo_expr*>::const_iterator end = udf->getRecursiveCalls().end();
             for (; ite != end; ++ite)
             {
-              user_function* recursiveUdf = 
-              static_cast<user_function*>((*ite)->get_func());
-
               applyInternal(*ite, true);
             }
           }

=== modified file 'src/functions/func_collections_impl.cpp'
--- src/functions/func_collections_impl.cpp	2012-10-15 13:35:59 +0000
+++ src/functions/func_collections_impl.cpp	2012-10-18 20:10:32 +0000
@@ -20,6 +20,8 @@
 
 #include "compiler/expression/expr_consts.h"
 #include "compiler/expression/expr_base.h"
+#include "compiler/expression/fo_expr.h"
+
 #include "compiler/expression/pragma.h"
 #include "compiler/api/compilercb.h"
 
@@ -63,6 +65,39 @@
 /*******************************************************************************
 
 ********************************************************************************/
+xqtref_t static_collections_dml_collection::getReturnType(const fo_expr* caller) const
+{
+  if (getName()->getNamespace() ==
+      static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS)
+  {
+    return theSignature.returnType();
+  }
+
+  static_context* sctx = caller->get_sctx();
+
+  const store::Item* qname = caller->get_arg(0)->getQName(sctx);
+
+  if (qname != NULL)
+  {
+    const StaticallyKnownCollection* collection = sctx->lookup_collection(qname);
+
+    if (collection != NULL)
+    {
+      return collection->getCollectionType();
+    }
+    else
+    {
+      RAISE_ERROR(zerr::ZDDY0001_COLLECTION_NOT_DECLARED, caller->get_loc(),
+      ERROR_PARAMS(qname->getStringValue()));
+    }
+  }
+  else
+  {
+    return theSignature.returnType();
+  }
+}
+
+
 PlanIter_t static_collections_dml_collection::codegen(
   CompilerCB*,
   static_context* sctx,
@@ -139,14 +174,14 @@
 /*******************************************************************************
 
 ********************************************************************************/
-void
-zorba::static_collections_dml_insert_nodes::processPragma(
+void zorba::static_collections_dml_insert_nodes::processPragma(
     zorba::expr* e,
     const std::vector<zorba::pragma*>& p) const
 {
   processPragmaInternal(e, p);
 }
 
+
 PlanIter_t static_collections_dml_insert_nodes::codegen(
     CompilerCB* cb,
     static_context* sctx,

=== modified file 'src/functions/pregenerated/func_collections.h'
--- src/functions/pregenerated/func_collections.h	2012-10-08 12:09:36 +0000
+++ src/functions/pregenerated/func_collections.h	2012-10-18 20:10:32 +0000
@@ -146,6 +146,8 @@
 
   bool accessesDynCtx() const { return true; }
 
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
   bool isSource() const { return true; }
 
   FunctionConsts::AnnotationValue producesDistinctNodes() const 

=== modified file 'src/runtime/spec/collections/collections.xml'
--- src/runtime/spec/collections/collections.xml	2012-10-08 12:09:36 +0000
+++ src/runtime/spec/collections/collections.xml	2012-10-18 20:10:32 +0000
@@ -284,6 +284,7 @@
 
       <zorba:methods>
         <zorba:accessesDynCtx returnValue="true"/>
+        <zorba:getReturnType/>
         <zorba:isSource returnValue="true"/>
         <zorba:producesDistinctNodes returnValue="YES"/>
         <zorba:producesSortedNodes returnValue="YES"/>

=== modified file 'src/types/typeops.cpp'
--- src/types/typeops.cpp	2012-09-19 21:16:15 +0000
+++ src/types/typeops.cpp	2012-10-18 20:10:32 +0000
@@ -475,6 +475,9 @@
   CHECK_IN_SCOPE(tm, subtype, loc);
   CHECK_IN_SCOPE(tm, supertype, loc);
 
+  if (&subtype == &supertype)
+    return true;
+
   if (subtype.type_kind() == XQType::NONE_KIND)
     return true;
 

=== modified file 'test/rbkt/Queries/zorba/block/local_var3.xq'
--- test/rbkt/Queries/zorba/block/local_var3.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/block/local_var3.xq	2012-10-18 20:10:32 +0000
@@ -11,7 +11,7 @@
   for $i in (1, 2)
   return
     {
-      variable $dummy := {$x := $i + $y; };
+      variable $dummy := { $x := $i + $y; () };
       $x
     }
 };
@@ -20,7 +20,7 @@
 for $i in (10, 20, 30)
 return
   {
-    variable $dummy := { $result := local:f($i); };
+    variable $dummy := { $result := local:f($i); () };
     $result
   }
 

=== modified file 'test/rbkt/Queries/zorba/index/auctions1u.xq'
--- test/rbkt/Queries/zorba/index/auctions1u.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/index/auctions1u.xq	2012-10-18 20:10:32 +0000
@@ -26,6 +26,8 @@
 
   index_dml:refresh-index($emp-id);
   (: don't refresh the emp-city index manually because it's done automatically :)
+
+  ()
 }
 ,
 "
@@ -44,6 +46,7 @@
 ,
 {
   dml:insert-nodes($auctions:auctions, doc("auctions2.xml"));
+  ()
 }
 ,
 "

=== modified file 'test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.xq'
--- test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.xq	2012-04-11 20:22:52 +0000
+++ test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.xq	2012-10-18 20:10:32 +0000
@@ -9,7 +9,7 @@
 
 declare variable $coll1 := xs:QName("collection1");
 
-ddl:create($coll1, (<a/>, { "p1":1, "p2":2 }, {}, [1, 2, 3]));
+ddl:create($coll1, (<a/>, { "p1":1, "p2":2 }, {||}, [1, 2, 3]));
 
 dml:collection($coll1)
 

=== modified file 'test/rbkt/Queries/zorba/scripting/flwor10.xq'
--- test/rbkt/Queries/zorba/scripting/flwor10.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/scripting/flwor10.xq	2012-10-18 20:10:32 +0000
@@ -3,5 +3,5 @@
 variable $x := 0;
 
 for $i in (1, 2, 3)
-let $y := { $x := $x + $i; }
+let $y := { $x := $x + $i; () }
 return $x

=== modified file 'test/rbkt/Queries/zorba/scripting/flwor11.xq'
--- test/rbkt/Queries/zorba/scripting/flwor11.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/scripting/flwor11.xq	2012-10-18 20:10:32 +0000
@@ -2,6 +2,6 @@
 
 variable $x := 0;
 
-let $y := { $x := $x + 1; }
+let $y := { $x := $x + 1; () }
 for $i in (1, 2, 3)
 return $x + $i

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/dic1.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/dic1.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/dic1.xq	2012-10-18 20:10:32 +0000
@@ -22,8 +22,13 @@
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
 },
 {
 <newline> a

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/dic2.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/dic2.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/dic2.xq	2012-10-18 20:10:32 +0000
@@ -22,8 +22,13 @@
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
 },
 {
 <newline> a

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/dic3.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/dic3.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/dic3.xq	2012-10-18 20:10:32 +0000
@@ -11,25 +11,35 @@
 {
 <newline>
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return $i/name
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 dml:collection($xqddf-test:white-collection)/name
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/dic4.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/dic4.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/dic4.xq	2012-10-18 20:10:32 +0000
@@ -10,29 +10,40 @@
 {
 <newline>
 </newline>
-},
-
-{
-for $i in fn:doc("auction.xml")//item
-return $i/name
-},
-{
-<newline> a
-</newline>
-},
-{
-for $i in fn:doc("auction.xml")//item
-return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
-{
-<newline> a
-</newline>
-},
-{
-dml:delete-nodes(dml:collection($xqddf-test:white-collection)[1]);
-},
-{
-dml:collection($xqddf-test:white-collection)/name
+}
+,
+{
+  for $i in fn:doc("auction.xml")//item
+  return $i/name
+}
+,
+{
+<newline> a
+</newline>
+}
+,
+{
+  for $i in fn:doc("auction.xml")//item
+  return 
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
+{
+<newline> a
+</newline>
+}
+,
+{
+  dml:delete-nodes(dml:collection($xqddf-test:white-collection)[1]);
+  ()
+}
+,
+{
+  dml:collection($xqddf-test:white-collection)/name
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/eic1.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/eic1.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/eic1.xq	2012-10-18 20:10:32 +0000
@@ -10,25 +10,35 @@
 {
 <newline>
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return fn:string(($i/description/parlist/listitem/text)[1])
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-   {{fn:string(($i/description/parlist/listitem/text)[1])},
-   { dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
+  {
+    { fn:string(($i/description/parlist/listitem/text)[1]) },
+    { dml:insert-nodes($xqddf-test:white-collection,
+      (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 dml:collection($xqddf-test:white-collection)/description/parlist/listitem/text
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/eic2.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/eic2.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/eic2.xq	2012-10-18 20:10:32 +0000
@@ -10,25 +10,35 @@
 {
 <newline>
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return $i/name
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return
-    {{$i/name}, 
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
+  {
+    { $i/name }, 
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 dml:collection($xqddf-test:white-collection)/name
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/eic3.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/eic3.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/eic3.xq	2012-10-18 20:10:32 +0000
@@ -11,33 +11,45 @@
 {
 <newline>
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return fn:string(($i/description/parlist/listitem/text)[1])
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return $i/name
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 dml:collection($xqddf-test:white-collection)/description/parlist/listitem/text
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/eic4.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/eic4.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/eic4.xq	2012-10-18 20:10:32 +0000
@@ -10,28 +10,40 @@
 {
 <newline>
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return fn:string(($i/description/parlist/listitem/text)[1])
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-   {{fn:string(($i/description/parlist/listitem/text)[1])},
-   { dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
+  {
+    { fn:string(($i/description/parlist/listitem/text)[1]) },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
 {
 dml:delete-nodes(dml:collection($xqddf-test:white-collection)[1]);
-},
+()
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 dml:collection($xqddf-test:white-collection)/description/parlist/listitem/text
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/i6.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/i6.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/i6.xq	2012-10-18 20:10:32 +0000
@@ -12,31 +12,37 @@
 
 for $i in fn:doc("auction.xml")//item
 return 
-    dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));
+    dml:insert-nodes($xqddf-test:white-collection,
+                     (copy $copyi := $i modify () return $copyi));
 
 
 index_dml:refresh-index($xqddf-test:index2);
+
 (:xqddf:collection($xqddf-test:white-collection);:)
+
 {
 <newline>
 </newline>
-},
-
+}
+,
 {
 index_dml:probe-index-point-value($xqddf-test:index1, "United States")[@id="item0"]/name
-},
-
+}
+,
 {
 index_dml:probe-index-range-value($xqddf-test:index2, 1, 3, fn:true(), fn:true(), fn:true(), fn:false())[@id="item2"]
-},
+}
+,
 {
 rename node dml:collection($xqddf-test:white-collection)[@id="item0"]/location as "location2";
-},
+()
+}
+,
 {
 <newline> a
 </newline>
-},
-
+}
+,
 {
 index_dml:probe-index-point-value($xqddf-test:index1, "United States")[@id="item1"]/name
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/ric1.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/ric1.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/ric1.xq	2012-10-18 20:10:32 +0000
@@ -20,18 +20,29 @@
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:blue-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 dml:collection($xqddf-test:white-collection)/name
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/ric2.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/ric2.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/ric2.xq	2012-10-18 20:10:32 +0000
@@ -11,30 +11,46 @@
 {
 <newline>
 </newline>
-},
-
+}
+,
 {
-for $i in fn:doc("auction.xml")//item
-return $i/name;
-},
+  for $i in fn:doc("auction.xml")//item
+  return $i/name;
+  ()
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:blue-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi)); 
+      ()
+    }
+  }
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 dml:delete-nodes(dml:collection($xqddf-test:blue-collection)[1]);
-},
+()
+}
+,
 {
 dml:collection($xqddf-test:white-collection)/name;
+()
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/ric3.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/ric3.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/ric3.xq	2012-10-18 20:10:32 +0000
@@ -20,6 +20,7 @@
 {
   for $i in fn:doc("auction.xml")//item
   return $i/name;
+  ()
 },
 
 
@@ -32,14 +33,17 @@
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    
-    { 
-      { $i/name },
-      { dml:insert-nodes($xqddf-test:blue-collection,
-                                 (copy $copyi := $i modify () return $copyi)); },
-      { dml:insert-nodes($xqddf-test:white-collection,
-                                 (copy $copyi := $i modify () return $copyi)); }
+  { 
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:blue-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                                 (copy $copyi := $i modify () return $copyi));
+      ()
     }
+  }
 },
 
 
@@ -52,9 +56,11 @@
 {
   replace value of node dml:collection($xqddf-test:blue-collection)[1]/name 
           with "replaced name";
+  ()
 },
 
 
 {
   dml:collection($xqddf-test:white-collection)/name;
+  ()
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/ric4.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/ric4.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/ric4.xq	2012-10-18 20:10:32 +0000
@@ -14,8 +14,8 @@
 },
 
 {
-for $i in fn:doc("auction.xml")//item
-return $i/name
+  for $i in fn:doc("auction.xml")//item
+  return $i/name
 },
 
 {
@@ -26,9 +26,17 @@
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:blue-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
 },
 
 {
@@ -41,6 +49,7 @@
 
 replace value of node dml:collection($xqddf-test:blue-collection)[1]/name 
         with "gaze wages proving english ";
+()
 },
 
 {

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/ric5.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/ric5.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/ric5.xq	2012-10-18 20:10:32 +0000
@@ -11,30 +11,44 @@
 {
 <newline>
 </newline>
-},
-
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return $i/name
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:blue-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 dml:delete-nodes(dml:collection($xqddf-test:white-collection)[1]);
-},
+()
+}
+,
 {
 dml:collection($xqddf-test:white-collection)/name
 }

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/ric6.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/ric6.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/ric6.xq	2012-10-18 20:10:32 +0000
@@ -16,27 +16,48 @@
 {
 for $i in fn:doc("auction.xml")//item
 return $i/name
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
-},
-{
-try{
-    (dml:insert-nodes($xqddf-test:blue-collection, (fn:doc("auction.xml")//item)[@id="item0"]),
-    dml:delete-nodes(dml:collection($xqddf-test:blue-collection)[@id="item0"]));
-}
-catch * { "
-cannot delete first item in blue collection";
-}
-},
+  {
+    { $i/name }
+    ,
+    { dml:insert-nodes($xqddf-test:blue-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+    ,
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
+}
+,
+{
+try
+{
+  {
+    (dml:insert-nodes($xqddf-test:blue-collection,
+                      (fn:doc("auction.xml")//item)[@id="item0"]),
+
+     dml:delete-nodes(dml:collection($xqddf-test:blue-collection)[@id="item0"]));
+     ()
+   }
+}
+catch * 
+{ "
+cannot delete first item in blue collection"
+}
+}
+,
 {
 <newline> a
 </newline>

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/undo1.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/undo1.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/undo1.xq	2012-10-18 20:10:32 +0000
@@ -16,17 +16,27 @@
 {
 for $i in fn:doc("auction.xml")//item
 return $i/name
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $i in fn:doc("auction.xml")//item
 return 
-    {{$i/name},
-    {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));},
-    {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}}
+  {
+    { $i/name },
+    { dml:insert-nodes($xqddf-test:blue-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    },
+    { dml:insert-nodes($xqddf-test:white-collection,
+                       (copy $copyi := $i modify () return $copyi));
+      ()
+    }
+  }
 },
 {
   try
@@ -40,20 +50,24 @@
   catch * { "
 cannot delete first item in blue collection"
   }
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $x in dml:collection($xqddf-test:white-collection)
 order by number(substring-after($x/@id, "item"))
 return $x/name
-},
+}
+,
 {
 <newline> a
 </newline>
-},
+}
+,
 {
 for $x in dml:collection($xqddf-test:blue-collection)
 order by number(substring-after($x/@id, "item"))

=== modified file 'test/rbkt/Queries/zorba/xqddf/daniel/undo2.xq'
--- test/rbkt/Queries/zorba/xqddf/daniel/undo2.xq	2012-09-19 21:16:15 +0000
+++ test/rbkt/Queries/zorba/xqddf/daniel/undo2.xq	2012-10-18 20:10:32 +0000
@@ -9,43 +9,49 @@
 {
 <newline>
 </newline>
-},
-
+}
+,
 {
 
 for $i in fn:doc("auction.xml")//item
 return 
-    dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));
+    dml:insert-nodes($xqddf-test:white-collection,
+                     (copy $copyi := $i modify () return $copyi));
 
 index_ddl:create($xqddf-test:index1);
-},
 
+()
+}
+,
 {
 dml:insert-nodes($xqddf-test:white-collection, <item><location>Earth3</location></item>);
-},
-
+()
+}
+,
 {
 index_dml:probe-index-point-value($xqddf-test:index1, "Earth3")[1]
-},
-
+}
+,
 {
 try
 {
   {
-    dml:insert-nodes($xqddf-test:white-collection, <item><location>Earth</location></item>);
+    dml:insert-nodes($xqddf-test:white-collection,
+                     <item><location>Earth</location></item>);
     dml:insert-nodes($xqddf-test:white-collection, "");
     ()
   }
 }
 catch * { "
 cannot insert empty item in white collection"}
-},
-
+}
+,
 {
 <newline> a
 </newline>
-},
-
+}
+,
 {
 index_dml:probe-index-point-value($xqddf-test:index1, "Earth")[1];
+()
 }

=== modified file 'test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq'
--- test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq	2012-10-08 12:09:36 +0000
+++ test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq	2012-10-18 20:10:32 +0000
@@ -18,6 +18,7 @@
  :)
 declare variable $ZorbaManifestPath as xs:string external;
 
+
 declare %private %ann:nondeterministic function local:load-manifest()
 {
   try 
@@ -30,6 +31,7 @@
   }
 };
 
+
 (:~
  : This function generates the XQDoc XML for all correctly configured in Zorba 
  : (in other words all modules present in ZorbaManifest.xml) and checks if the modules are correctly documented.
@@ -70,16 +72,21 @@
             local:test-functions($xqdoc),
             local:test-variables($xqdoc)
           ),"")
-      } catch * {
-    fn:concat("ERROR: ", $err:code, " Message: ", $err:description, "
+      }
+      catch *
+      {
+        fn:concat("ERROR: ", $err:code,
+                  " Message: ", $err:description,
+                  " Line: ", $err:line-number, "
 processing module: ", $moduleURI)
       }
-     };
+    };
      
-   fn:string-join($res,"")
-   }
+    fn:string-join($res,"")
+  }
 };
 
+
 declare function local:test-module($xqdoc as element(xqdoc:xqdoc)) as xs:string?
 {
   let $module := $xqdoc/xqdoc:module/xqdoc:comment
@@ -119,9 +126,11 @@
   ),"")  
 };
 
+
 declare function local:test-functions(
   $xqdoc as element(xqdoc:xqdoc)
-)as xs:string? {
+)as xs:string? 
+{
     let $module := $xqdoc/xqdoc:module
     return
       string-join(for $function in $xqdoc/xqdoc:functions/xqdoc:function
@@ -129,6 +138,7 @@
       return local:test-function($module, $function),"")
 };
 
+
 declare function local:test-function(
   $module as element(xqdoc:module),
   $function as element(xqdoc:function)
@@ -182,9 +192,11 @@
     ),"")
 };
 
+
 declare function local:test-variables(
   $xqdoc as element(xqdoc:xqdoc)
-) as xs:string? {
+) as xs:string?
+{
     let $module := $xqdoc/xqdoc:module
     let $moduleUri := $module/xqdoc:uri
     return
@@ -192,10 +204,12 @@
       return local:test-variable($module, $variable),"")
 };
 
+
 declare function local:test-variable(
   $module as element(xqdoc:module),
   $variable as element(xqdoc:variable)
-) as xs:string? {
+) as xs:string?
+{
     let $hasDescr := exists($variable/xqdoc:comment/xqdoc:description)
     return
         (: Test for variable description :)

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to