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

Commit message:
implicit iteration for jsoniq delete and replace exprs

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

implicit iteration for jsoniq delete and replace exprs
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/180865
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-08-16 13:00:06 +0000
+++ src/compiler/translator/translator.cpp	2013-08-19 13:02:29 +0000
@@ -15199,7 +15199,7 @@
 
   PostfixExpr := PostfixExpr ("(" ArgList ")")+
 
-  The parser also makes sure that each ArgList contains exactly one arg.
+  The parser also makes sure that the last ArgList contains exactly one arg.
 
   If there are N ArgLists, the last one is considered to be the selector expr
   and the PrimaryExpr together with the N-1 ArgLists constitute the target expr.
@@ -15215,26 +15215,18 @@
 {
   TRACE_VISIT_OUT();
 
-  expr* selExpr = pop_nodestack();
+  expr* selectorExpr = pop_nodestack();
   expr* targetExpr = pop_nodestack();
 
-  selExpr = wrap_in_type_promotion(selExpr,
-                                   theRTM.ANY_ATOMIC_TYPE_ONE,
-                                   PROMOTE_JSONIQ_SELECTOR, // JNUP0007
-                                   NULL);
-
-  targetExpr = wrap_in_type_match(targetExpr,
-                                  theRTM.JSON_ITEM_TYPE_ONE,
-                                  loc,
-                                  TREAT_JSONIQ_UPDATE_TARGET, // JNUP0008
-                                  NULL);
-
-  fo_expr* updExpr = theExprManager->
-  create_fo_expr(theRootSctx, theUDF,
-                 loc,
-                 BUILTIN_FUNC(OP_ZORBA_JSON_DELETE_2),
-                 targetExpr,
-                 selExpr);
+  selectorExpr = wrap_in_type_promotion(selectorExpr,
+                                        theRTM.ANY_ATOMIC_TYPE_QUESTION,
+                                        PROMOTE_TYPE_PROMOTION,
+                                        NULL);
+
+  fo_expr* updExpr = CREATE(fo)(theRootSctx, theUDF, loc,
+                                BUILTIN_FUNC(OP_ZORBA_JSON_DELETE_2),
+                                targetExpr,
+                                selectorExpr);
 
   push_nodestack(updExpr);
 }
@@ -15255,32 +15247,25 @@
   TRACE_VISIT_OUT();
 
   expr* valueExpr = pop_nodestack();
-  expr* selExpr = pop_nodestack();
+  expr* selectorExpr = pop_nodestack();
   expr* targetExpr = pop_nodestack();
 
   std::vector<expr*> args(3);
 
-  args[0] = wrap_in_type_match(targetExpr,
-                               theRTM.JSON_ITEM_TYPE_ONE,
-                               loc,
-                               TREAT_JSONIQ_UPDATE_TARGET, // JNUP0008
-                               NULL);
+  args[0] = targetExpr;
 
-  args[1] = wrap_in_type_promotion(selExpr,
-                                   theRTM.ANY_ATOMIC_TYPE_ONE,
-                                   PROMOTE_JSONIQ_SELECTOR, // JNUP0007
+  args[1] = wrap_in_type_promotion(selectorExpr,
+                                   theRTM.ANY_ATOMIC_TYPE_QUESTION,
+                                   PROMOTE_TYPE_PROMOTION,
                                    NULL);
 
-  args[2] = theExprManager->create_fo_expr(theRootSctx, theUDF,
-                                           valueExpr->get_loc(),
-                                           BUILTIN_FUNC(OP_ZORBA_JSON_BOX_1),
-                                           valueExpr);
+  args[2] = CREATE(fo)(theRootSctx, theUDF, valueExpr->get_loc(),
+                       BUILTIN_FUNC(OP_ZORBA_JSON_BOX_1),
+                       valueExpr);
 
-  fo_expr* updExpr = theExprManager->
-  create_fo_expr(theRootSctx, theUDF,
-                 loc,
-                 BUILTIN_FUNC(OP_ZORBA_JSON_REPLACE_VALUE_3),
-                 args);
+  fo_expr* updExpr = CREATE(fo)(theRootSctx, theUDF, loc,
+                                BUILTIN_FUNC(OP_ZORBA_JSON_REPLACE_VALUE_3),
+                                args);
 
   push_nodestack(updExpr);
 }
@@ -15314,7 +15299,7 @@
 
   args[1] = wrap_in_type_promotion(nameExpr,
                                    theRTM.STRING_TYPE_ONE,
-                                   PROMOTE_JSONIQ_OBJECT_SELECTOR); // JNUP0007
+                                   PROMOTE_TYPE_PROMOTION);
 
   args[2] = wrap_in_type_promotion(newNameExpr,
                                    theRTM.STRING_TYPE_ONE,

=== modified file 'src/functions/pregenerated/func_jsoniq_functions.cpp'
--- src/functions/pregenerated/func_jsoniq_functions.cpp	2013-08-16 16:05:18 +0000
+++ src/functions/pregenerated/func_jsoniq_functions.cpp	2013-08-19 13:02:29 +0000
@@ -173,7 +173,7 @@
   std::vector<PlanIter_t>& argv,
   expr& ann) const
 {
-  return new JSONDeleteIterator(sctx, loc, argv);
+  return new JSONDeleteIterator(sctx, loc, argv[0], argv[1]);
 }
 
 
@@ -477,8 +477,8 @@
       {
     DECL_WITH_KIND(sctx, op_zorba_json_delete,
         (createQName("http://zorba.io/internal/zorba-ops","","json-delete";), 
-        GENV_TYPESYSTEM.JSON_ITEM_TYPE_ONE, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
         GENV_TYPESYSTEM.EMPTY_TYPE),
         FunctionConsts::OP_ZORBA_JSON_DELETE_2);
 
@@ -490,8 +490,8 @@
       {
     DECL_WITH_KIND(sctx, op_zorba_json_replace_value,
         (createQName("http://zorba.io/internal/zorba-ops","","json-replace-value";), 
-        GENV_TYPESYSTEM.JSON_ITEM_TYPE_ONE, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
         GENV_TYPESYSTEM.ITEM_TYPE_ONE, 
         GENV_TYPESYSTEM.EMPTY_TYPE),
         FunctionConsts::OP_ZORBA_JSON_REPLACE_VALUE_3);

=== modified file 'src/runtime/json/jsoniq_functions_impl.cpp'
--- src/runtime/json/jsoniq_functions_impl.cpp	2013-08-16 13:00:06 +0000
+++ src/runtime/json/jsoniq_functions_impl.cpp	2013-08-19 13:02:29 +0000
@@ -1730,8 +1730,8 @@
 
 /*******************************************************************************
   updating function op-zorba:json-delete(
-      $target as json-item(),
-      $selector as xs:anyAtomicType) 
+      $target as item()*,
+      $selector as xs:anyAtomicType?) 
 ********************************************************************************/
 bool JSONDeleteIterator::nextImpl(
     store::Item_t& result, 
@@ -1741,57 +1741,49 @@
   store::Item_t selector;
   store::PUL_t pul;
 
-  const TypeManager* tm = theSctx->get_typemanager();
-
   PlanIteratorState* state;
   DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
 
-  consumeNext(target, theChildren[0].getp(), planState);
-  consumeNext(selector, theChildren[1].getp(), planState);
-
-  pul = GENV_ITEMFACTORY->createPendingUpdateList();
-
-  if (target->isObject())
-  {
-    store::SchemaTypeCode type = selector->getTypeCode();
-
-    if (type != store::XS_STRING && type != store::XS_ANY_URI)
-    {
-      xqtref_t type = tm->create_value_type(selector, loc);
-
-      RAISE_ERROR(jerr::JNUP0007, loc, 
-      ERROR_PARAMS(ZED(JNUP0007_Object), type->toSchemaString()));
-    }
-
-    pul->addJSONObjectDelete(&loc, target, selector);
-  }
-  else if (target->isArray())
-  {
-    store::SchemaTypeCode type = selector->getTypeCode();
-
-    if (type != store::XS_INTEGER)
-    {
-      xqtref_t type = tm->create_value_type(selector, loc);
-
-      RAISE_ERROR(jerr::JNUP0007, loc, 
-      ERROR_PARAMS(ZED(JNUP0007_Array), type->toSchemaString()));
-    }
-
-    pul->addJSONArrayDelete(&loc, target, selector);
-  }
-
-  result.transfer(pul);
-
-  STACK_PUSH(true, state);
-
-  STACK_END (state);
+  if (consumeNext(selector, theChild1.getp(), planState))
+  {
+    pul = GENV_ITEMFACTORY->createPendingUpdateList();
+
+    while (consumeNext(target, theChild0.getp(), planState))
+    {
+      if (target->isObject())
+      {
+        pul->addJSONObjectDelete(&loc, target, selector);
+      }
+      else if (target->isArray())
+      {
+        store::SchemaTypeCode selectorType = selector->getTypeCode();
+
+        if (!TypeOps::is_subtype(selectorType, store::XS_INTEGER))
+        {
+          GenericCast::castToBuiltinAtomic(selector,
+                                           selector,
+                                           store::XS_INTEGER,
+                                           NULL,
+                                           loc);
+        }
+
+        pul->addJSONArrayDelete(&loc, target, selector);
+      }
+    }
+     
+    result.transfer(pul);
+
+    STACK_PUSH(true, state);
+  }
+
+  STACK_END(state);
 }
 
 
 /*******************************************************************************
   updating function op-zorba:replace-value(
-      $target as json-item(),
-      $selector as xs:anyAtomicType, 
+      $target as item()*,
+      $selector as xs:anyAtomicType?, 
       $newValue as item()) 
 ********************************************************************************/
 JSONReplaceValueIterator::JSONReplaceValueIterator(
@@ -1822,60 +1814,56 @@
   store::Item_t newValue;
   store::PUL_t pul;
   store::CopyMode copymode;
-
-  const TypeManager* tm = theSctx->get_typemanager();
+  bool copyInput = theCopyInput;
 
   PlanIteratorState* state;
   DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
 
-  consumeNext(target, theChildren[0].getp(), planState);
-  consumeNext(selector, theChildren[1].getp(), planState);
-  consumeNext(newValue, theChildren[2].getp(), planState);
-
-  if (theCopyInput && (newValue->isStructuredItem()))
-  {
-    copymode.set(true, 
-                 theSctx->construction_mode() == StaticContextConsts::cons_preserve,
-                 theSctx->preserve_ns(),
-                 theSctx->inherit_ns());
-
-    newValue = newValue->copy(NULL, copymode);
-  }
-
-  pul = GENV_ITEMFACTORY->createPendingUpdateList();
-
-  if (target->isObject())
-  {
-    store::SchemaTypeCode type = selector->getTypeCode();
-
-    if (type != store::XS_STRING && type != store::XS_ANY_URI)
-    {
-      xqtref_t type = tm->create_value_type(selector, loc);
-
-      RAISE_ERROR(jerr::JNUP0007, loc, 
-      ERROR_PARAMS(ZED(JNUP0007_Object), type->toSchemaString()));
-    }
-
-    pul->addJSONObjectReplaceValue(&loc, target, selector, newValue);
-  }
-  else if (target->isArray())
-  {
-    store::SchemaTypeCode type = selector->getTypeCode();
-
-    if (type != store::XS_INTEGER)
-    {
-      xqtref_t type = tm->create_value_type(selector, loc);
-
-      RAISE_ERROR(jerr::JNUP0007, loc, 
-      ERROR_PARAMS(ZED(JNUP0007_Array), type->toSchemaString()));
-    }
-
-    pul->addJSONArrayReplaceValue(&loc, target, selector, newValue);
-  }
-
-  result.transfer(pul);
-
-  STACK_PUSH(true, state);
+  if (consumeNext(selector, theChildren[1].getp(), planState))
+  {
+    pul = GENV_ITEMFACTORY->createPendingUpdateList();
+
+    consumeNext(newValue, theChildren[2].getp(), planState);
+
+    while (consumeNext(target, theChildren[0].getp(), planState))
+    {
+      if (copyInput && (newValue->isStructuredItem()))
+      {
+        copymode.set(true,
+                     theSctx->construction_mode() == StaticContextConsts::cons_preserve,
+                     theSctx->preserve_ns(),
+                     theSctx->inherit_ns());
+        
+        newValue = newValue->copy(NULL, copymode);
+      }
+
+      copyInput = true;
+
+      if (target->isObject())
+      {
+        pul->addJSONObjectReplaceValue(&loc, target, selector, newValue);
+      }
+      else if (target->isArray())
+      {
+        store::SchemaTypeCode selectorType = selector->getTypeCode();
+
+        if (!TypeOps::is_subtype(selectorType, store::XS_INTEGER))
+        {
+          GenericCast::castToBuiltinAtomic(selector,
+                                           selector,
+                                           store::XS_INTEGER,
+                                           NULL,
+                                           loc);
+        }
+
+        pul->addJSONArrayReplaceValue(&loc, target, selector, newValue);
+      }
+    }
+
+    result.transfer(pul);
+
+    STACK_PUSH(true, state);
+  }
 
   STACK_END(state);
 }

=== modified file 'src/runtime/json/pregenerated/jsoniq_functions.cpp'
--- src/runtime/json/pregenerated/jsoniq_functions.cpp	2013-08-16 13:00:06 +0000
+++ src/runtime/json/pregenerated/jsoniq_functions.cpp	2013-08-19 13:02:29 +0000
@@ -620,7 +620,7 @@
 void JSONDeleteIterator::serialize(::zorba::serialization::Archiver& ar)
 {
   serialize_baseclass(ar,
-  (NaryBaseIterator<JSONDeleteIterator, PlanIteratorState>*)this);
+  (BinaryBaseIterator<JSONDeleteIterator, PlanIteratorState>*)this);
 }
 
 
@@ -628,11 +628,8 @@
 {
   v.beginVisit(*this);
 
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
+  theChild0->accept(v);
+theChild1->accept(v);
 
   v.endVisit(*this);
 }

=== modified file 'src/runtime/json/pregenerated/jsoniq_functions.h'
--- src/runtime/json/pregenerated/jsoniq_functions.h	2013-08-16 13:00:06 +0000
+++ src/runtime/json/pregenerated/jsoniq_functions.h	2013-08-19 13:02:29 +0000
@@ -773,26 +773,26 @@
 
 /**
  * 
- *      json:delete-member
- *    
+ *    json:delete-member
+ *  
  * Author: Zorba Team
  */
-class JSONDeleteIterator : public NaryBaseIterator<JSONDeleteIterator, PlanIteratorState>
+class JSONDeleteIterator : public BinaryBaseIterator<JSONDeleteIterator, PlanIteratorState>
 { 
 public:
   SERIALIZABLE_CLASS(JSONDeleteIterator);
 
   SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONDeleteIterator,
-    NaryBaseIterator<JSONDeleteIterator, PlanIteratorState>);
+    BinaryBaseIterator<JSONDeleteIterator, PlanIteratorState>);
 
   void serialize( ::zorba::serialization::Archiver& ar);
 
   JSONDeleteIterator(
     static_context* sctx,
     const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
+    PlanIter_t& child1, PlanIter_t& child2)
     : 
-    NaryBaseIterator<JSONDeleteIterator, PlanIteratorState>(sctx, loc, children)
+    BinaryBaseIterator<JSONDeleteIterator, PlanIteratorState>(sctx, loc, child1, child2)
   {}
 
   virtual ~JSONDeleteIterator();
@@ -805,8 +805,8 @@
 
 /**
  * 
- *      internal function
- *    
+ *    internal function
+ *  
  * Author: Zorba Team
  */
 class JSONReplaceValueIterator : public NaryBaseIterator<JSONReplaceValueIterator, PlanIteratorState>

=== modified file 'src/runtime/spec/json/jsoniq_functions.xml'
--- src/runtime/spec/json/jsoniq_functions.xml	2013-08-16 16:05:18 +0000
+++ src/runtime/spec/json/jsoniq_functions.xml	2013-08-19 13:02:29 +0000
@@ -654,26 +654,26 @@
 ********************************************************************************/
 -->
 <zorba:iterator name="JSONDeleteIterator"
-                arity="nary">
-
-    <zorba:description author="Zorba Team">
-      json:delete-member
-    </zorba:description>
-
-    <zorba:function>
-
-      <zorba:signature localname="json-delete" prefix="op-zorba">
-        <zorba:param>json-item()</zorba:param>
-        <zorba:param>xs:anyAtomicType</zorba:param>
-        <zorba:output>empty-sequence()</zorba:output>
-      </zorba:signature>
-
-      <zorba:methods>
-        <zorba:getScriptingKind returnValue="UPDATING_EXPR"/>
-        <zorba:accessesDynCtx returnValue="true"/>
-      </zorba:methods>
-
-    </zorba:function>
+                arity="binary">
+
+  <zorba:description author="Zorba Team">
+    json:delete-member
+  </zorba:description>
+
+  <zorba:function>
+
+    <zorba:signature localname="json-delete" prefix="op-zorba">
+      <zorba:param>item()*</zorba:param>
+      <zorba:param>xs:anyAtomicType?</zorba:param>
+      <zorba:output>empty-sequence()</zorba:output>
+    </zorba:signature>
+
+    <zorba:methods>
+      <zorba:getScriptingKind returnValue="UPDATING_EXPR"/>
+      <zorba:accessesDynCtx returnValue="true"/>
+    </zorba:methods>
+    
+  </zorba:function>
 
 </zorba:iterator>
 
@@ -685,31 +685,31 @@
 <zorba:iterator name="JSONReplaceValueIterator" arity="nary"
                 generateConstructor="false">
 
-    <zorba:description author="Zorba Team">
-      internal function
-    </zorba:description>
-
-    <zorba:function generateCodegen="false">
-
-      <zorba:signature localname="json-replace-value" prefix="op-zorba">
-        <zorba:param>json-item()</zorba:param>
-        <zorba:param>xs:anyAtomicType</zorba:param>
-        <zorba:param>item()</zorba:param>
-        <zorba:output>empty-sequence()</zorba:output>
-      </zorba:signature>
-
-      <zorba:methods>
-        <zorba:getScriptingKind returnValue="UPDATING_EXPR"/>
-        <zorba:accessesDynCtx returnValue="true"/>
-        <zorba:mustCopyInputNodes/>
-      </zorba:methods>
-
-    </zorba:function>
+  <zorba:description author="Zorba Team">
+    internal function
+  </zorba:description>
+  
+  <zorba:function generateCodegen="false">
+
+    <zorba:signature localname="json-replace-value" prefix="op-zorba">
+      <zorba:param>item()*</zorba:param>
+      <zorba:param>xs:anyAtomicType?</zorba:param>
+      <zorba:param>item()</zorba:param>
+      <zorba:output>empty-sequence()</zorba:output>
+    </zorba:signature>
+
+    <zorba:methods>
+      <zorba:getScriptingKind returnValue="UPDATING_EXPR"/>
+      <zorba:accessesDynCtx returnValue="true"/>
+      <zorba:mustCopyInputNodes/>
+    </zorba:methods>
+
+  </zorba:function>
 
   <zorba:constructor generate="false">
     <zorba:parameter type="bool" name="copyInput" />
   </zorba:constructor>
-
+  
   <zorba:member type="bool" name="theCopyInput" />
 
 </zorba:iterator>

=== modified file 'src/store/naive/json_items.cpp'
--- src/store/naive/json_items.cpp	2013-06-05 00:37:35 +0000
+++ src/store/naive/json_items.cpp	2013-08-19 13:02:29 +0000
@@ -585,7 +585,8 @@
   }
   csize lPosition = lIter->second;
 
-  assert(thePairs[lPosition].first->equals(aKey));
+  assert(thePairs[lPosition].first->getStringValue() == lName);
+
   return thePairs[lPosition].second;
 }
 

=== modified file 'src/types/casting.cpp'
--- src/types/casting.cpp	2013-07-12 00:43:14 +0000
+++ src/types/casting.cpp	2013-08-19 13:02:29 +0000
@@ -2806,9 +2806,6 @@
   type TT. No casting is done if TI and TT are exactly the same type. If the
   cast is not allowed or is not possible, the method raises an error. Otherwise,
   it returns true.
-
-  Bug: no casting is done if TI is a user-defined type whose builtin base type
-  is TT. TODO fix this ???? 
 ********************************************************************************/
 bool GenericCast::castToBuiltinAtomic(
     store::Item_t& result,
@@ -2834,15 +2831,17 @@
   if (targetTypeCode == store::XS_NOTATION ||
       targetTypeCode == store::XS_ANY_ATOMIC)
   {
-    if ( throw_on_error )
+    if (throw_on_error)
       RAISE_ERROR(err::XPST0080, loc, ERROR_PARAMS(errInfo.theTargetTypeCode));
+
     return false;
   }
 
   if (sourceTypeCode == store::XS_ANY_ATOMIC)
   {
-    if ( throw_on_error )
+    if (throw_on_error)
       throwXPTY0004Exception(errInfo);
+
     return false;
   }
 
@@ -2850,8 +2849,9 @@
                                    [theMapping[targetTypeCode]];
   if (castFunc == 0)
   {
-    if ( throw_on_error )
+    if (throw_on_error)
       throwXPTY0004Exception(errInfo);
+
     return false;
   }
 
@@ -2860,7 +2860,7 @@
     item->getStringValue2(stringValue);
   }
 
-  if ( !(*castFunc)(result, item, stringValue, factory, nsCtx, errInfo, throw_on_error) )
+  if (!(*castFunc)(result, item, stringValue, factory, nsCtx, errInfo, throw_on_error))
     return false;
 
   DownCastFunc downCastFunc = theDownCastMatrix[theMapping[targetTypeCode]];
@@ -2869,7 +2869,12 @@
       targetTypeCode != store::XS_STRING &&
       targetTypeCode != store::XS_INTEGER)
   {
-    return (*downCastFunc)(result, &*result, targetTypeCode, factory, errInfo, throw_on_error);
+    return (*downCastFunc)(result,
+                           &*result,
+                           targetTypeCode,
+                           factory,
+                           errInfo,
+                           throw_on_error);
   }
 
   return true;

=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/jnty0008-4.xml.res'
=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/jnty0008-5.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/jnty0008-5.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/jnty0008-5.xml.res	2013-08-19 13:02:29 +0000
@@ -0,0 +1,1 @@
+[ "foo" ][ "foo" ]

=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/jnty0008-6.xml.res'
=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/jnty0008-7.xml.res'
=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/mixed-delete-01.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/mixed-delete-01.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/mixed-delete-01.xml.res	2013-08-19 13:02:29 +0000
@@ -0,0 +1,1 @@
+[  ][ 1, 2 ]1{  }<a/>

=== modified file 'test/rbkt/Queries/zorba/jsoniq/arr_delete_02.spec'
--- test/rbkt/Queries/zorba/jsoniq/arr_delete_02.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/arr_delete_02.spec	2013-08-19 13:02:29 +0000
@@ -1,1 +1,1 @@
-Error: http://jsoniq.org/errors:JNUP0007
+Error: http://www.w3.org/2005/xqt-errors:FORG0001

=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-1.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-1.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-1.spec	2013-08-19 13:02:29 +0000
@@ -1,1 +1,1 @@
-Error: http://jsoniq.org/errors:JNUP0007
+Error: http://jsoniq.org/errors:JNUP0016

=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-2.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-2.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-2.spec	2013-08-19 13:02:29 +0000
@@ -1,1 +1,1 @@
-Error: http://jsoniq.org/errors:JNUP0007
+Error: http://www.w3.org/2005/xqt-errors:FORG0001

=== added file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-3.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-3.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-3.spec	2013-08-19 13:02:29 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XPTY0004

=== added file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-3.xq'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-3.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-3.xq	2013-08-19 13:02:29 +0000
@@ -0,0 +1,6 @@
+
+copy $o := { "foo" : 1, "bar" : 2 }
+modify (
+  delete json $o(("foo", "bar"))
+)
+return $o

=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-5.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-5.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-5.spec	2013-08-19 13:02:29 +0000
@@ -1,1 +1,1 @@
-Error: http://jsoniq.org/errors:JNUP0007
+Error: http://www.w3.org/2005/xqt-errors:XPTY0004

=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-6.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-6.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-6.spec	2013-08-19 13:02:29 +0000
@@ -1,1 +1,1 @@
-Error: http://jsoniq.org/errors:JNUP0007
+Error: http://jsoniq.org/errors:JNUP0016

=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-7.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-7.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-7.spec	2013-08-19 13:02:29 +0000
@@ -1,1 +1,1 @@
-Error: http://jsoniq.org/errors:JNUP0007
+Error: http://www.w3.org/2005/xqt-errors:FORG0001

=== added file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-8.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-8.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-8.spec	2013-08-19 13:02:29 +0000
@@ -0,0 +1,1 @@
+Error: http://jsoniq.org/errors:JNTY0004

=== added file 'test/rbkt/Queries/zorba/jsoniq/jnty0007-8.xq'
--- test/rbkt/Queries/zorba/jsoniq/jnty0007-8.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0007-8.xq	2013-08-19 13:02:29 +0000
@@ -0,0 +1,5 @@
+copy $o := { "foo" : 1, "bar" : 2 }
+modify (
+  delete json $o({"foo" : "bar"})
+)
+return $o

=== removed file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-4.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0008-4.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-4.spec	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-Error: http://jsoniq.org/errors:JNUP0008

=== removed file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-5.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0008-5.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-5.spec	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-Error: http://jsoniq.org/errors:JNUP0008

=== modified file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-5.xq'
--- test/rbkt/Queries/zorba/jsoniq/jnty0008-5.xq	2012-06-19 14:58:25 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-5.xq	2013-08-19 13:02:29 +0000
@@ -1,3 +1,6 @@
-let $a := (["foo"], ["bar"])
-return
-  replace json value of $a(1) with "foo"
+declare variable $a := (["foo"], ["bar"]);
+
+replace json value of $a(1) with "foo";
+
+$a
+

=== removed file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-6.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0008-6.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-6.spec	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-Error: http://jsoniq.org/errors:JNUP0008

=== removed file 'test/rbkt/Queries/zorba/jsoniq/jnty0008-7.spec'
--- test/rbkt/Queries/zorba/jsoniq/jnty0008-7.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/jnty0008-7.spec	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-Error: http://jsoniq.org/errors:JNUP0008

=== added file 'test/rbkt/Queries/zorba/jsoniq/mixed-delete-01.xq'
--- test/rbkt/Queries/zorba/jsoniq/mixed-delete-01.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/mixed-delete-01.xq	2013-08-19 13:02:29 +0000
@@ -0,0 +1,5 @@
+declare variable $a := (["foo"], ["bar", 1, 2], 1, {"1" : "one"}, <a/>);
+
+delete json $a(1);
+
+$a

=== modified file 'test/rbkt/Queries/zorba/jsoniq/obj_delete_03.spec'
--- test/rbkt/Queries/zorba/jsoniq/obj_delete_03.spec	2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/jsoniq/obj_delete_03.spec	2013-08-19 13:02:29 +0000
@@ -1,1 +1,1 @@
-Error: http://jsoniq.org/errors:JNUP0007
+Error: http://jsoniq.org/errors:JNUP0016

-- 
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