Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Merged at revision: 11595
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 395 lines (+33/-141)
15 files modified
modules/org/jsoniq/www/functions.xq (+1/-11)
src/functions/func_jsoniq_functions_impl.cpp (+12/-0)
src/functions/pregenerated/func_jsoniq_functions.cpp (+2/-24)
src/functions/pregenerated/func_jsoniq_functions.h (+2/-15)
src/functions/pregenerated/function_enum.h (+0/-1)
src/runtime/json/jsoniq_functions_impl.cpp (+10/-7)
src/runtime/json/pregenerated/jsoniq_functions.cpp (+0/-24)
src/runtime/json/pregenerated/jsoniq_functions.h (+0/-30)
src/runtime/pregenerated/iterator_enum.h (+0/-1)
src/runtime/spec/json/jsoniq_functions.xml (+4/-4)
src/runtime/visitors/pregenerated/planiter_visitor.h (+0/-5)
src/runtime/visitors/pregenerated/printer_visitor.cpp (+0/-14)
src/runtime/visitors/pregenerated/printer_visitor.h (+0/-3)
test/rbkt/Queries/zorba/jsoniq/null04.xq (+1/-1)
test/rbkt/Queries/zorba/jsoniq/null05.xq (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+179692@code.launchpad.net

Commit message

removed jn:null() + allow empty seq as input to jn:size()

Description of the change

removed jn:null() + allow empty seq as input to jn:size()

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/179692

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/179692

Stage "TestZorbaUbuntu" failed.
1 tests failed (8402 total tests run).

Check test results at http://jenkins.lambda.nu/job/TestZorbaUbuntu/204/testReport/ to view the results.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/179692

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'modules/org/jsoniq/www/functions.xq'
--- modules/org/jsoniq/www/functions.xq 2013-08-12 09:59:18 +0000
+++ modules/org/jsoniq/www/functions.xq 2013-08-12 12:50:29 +0000
@@ -215,7 +215,7 @@
215 : @param $j A JSON Array.215 : @param $j A JSON Array.
216 : @return The number of items in $j.216 : @return The number of items in $j.
217 :)217 :)
218declare function jn:size($j as array()) as xs:integer external;218declare function jn:size($j as array()?) as xs:integer? external;
219219
220220
221(:~221(:~
@@ -260,14 +260,4 @@
260declare function jn:null() as js:null external;260declare function jn:null() as js:null external;
261261
262262
263(:~
264 : Tests whether the supplied atomic item is a JSON null.
265 :
266 : @param An atomic item.
267 :
268 : @return true if the item is of type js:null.
269 :)
270declare function jn:is-null($i as xs:anyAtomicType) as xs:boolean external;
271
272
273263
274264
=== modified file 'src/functions/func_jsoniq_functions_impl.cpp'
--- src/functions/func_jsoniq_functions_impl.cpp 2013-08-09 10:23:10 +0000
+++ src/functions/func_jsoniq_functions_impl.cpp 2013-08-12 12:50:29 +0000
@@ -70,6 +70,18 @@
70/*******************************************************************************70/*******************************************************************************
7171
72********************************************************************************/72********************************************************************************/
73xqtref_t fn_jsoniq_size::getReturnType(const fo_expr* caller) const
74{
75 if (caller->get_arg(0)->get_return_type()->get_quantifier() == TypeConstants::QUANT_ONE)
76 return GENV_TYPESYSTEM.INTEGER_TYPE_ONE;
77
78 return theSignature.returnType();
79}
80
81
82/*******************************************************************************
83
84********************************************************************************/
73PlanIter_t fn_jsoniq_keys::codegen(85PlanIter_t fn_jsoniq_keys::codegen(
74 CompilerCB*,86 CompilerCB*,
75 static_context* sctx,87 static_context* sctx,
7688
=== modified file 'src/functions/pregenerated/func_jsoniq_functions.cpp'
--- src/functions/pregenerated/func_jsoniq_functions.cpp 2013-08-12 10:27:18 +0000
+++ src/functions/pregenerated/func_jsoniq_functions.cpp 2013-08-12 12:50:29 +0000
@@ -154,16 +154,6 @@
154 return new JSONNullIterator(sctx, loc);154 return new JSONNullIterator(sctx, loc);
155}155}
156156
157PlanIter_t fn_jsoniq_is_null::codegen(
158 CompilerCB*,
159 static_context* sctx,
160 const QueryLoc& loc,
161 std::vector<PlanIter_t>& argv,
162 expr& ann) const
163{
164 return new JSONIsNullIterator(sctx, loc, argv[0]);
165}
166
167PlanIter_t op_zorba_json_object_insert::codegen(157PlanIter_t op_zorba_json_object_insert::codegen(
168 CompilerCB*,158 CompilerCB*,
169 static_context* sctx,159 static_context* sctx,
@@ -431,8 +421,8 @@
431 {421 {
432 DECL_WITH_KIND(sctx, fn_jsoniq_size,422 DECL_WITH_KIND(sctx, fn_jsoniq_size,
433 (createQName("http://jsoniq.org/functions","","size"), 423 (createQName("http://jsoniq.org/functions","","size"),
434 GENV_TYPESYSTEM.JSON_ARRAY_TYPE_ONE, 424 GENV_TYPESYSTEM.JSON_ARRAY_TYPE_QUESTION,
435 GENV_TYPESYSTEM.INTEGER_TYPE_ONE),425 GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION),
436 FunctionConsts::FN_JSONIQ_SIZE_1);426 FunctionConsts::FN_JSONIQ_SIZE_1);
437427
438 }428 }
@@ -464,18 +454,6 @@
464454
465455
466 {456 {
467 DECL_WITH_KIND(sctx, fn_jsoniq_is_null,
468 (createQName("http://jsoniq.org/functions","","is-null"),
469 GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE,
470 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
471 FunctionConsts::FN_JSONIQ_IS_NULL_1);
472
473 }
474
475
476
477
478 {
479 DECL_WITH_KIND(sctx, op_zorba_json_object_insert,457 DECL_WITH_KIND(sctx, op_zorba_json_object_insert,
480 (createQName("http://zorba.io/internal/zorba-ops","","json-object-insert"), 458 (createQName("http://zorba.io/internal/zorba-ops","","json-object-insert"),
481 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE, 459 GENV_TYPESYSTEM.JSON_OBJECT_TYPE_ONE,
482460
=== modified file 'src/functions/pregenerated/func_jsoniq_functions.h'
--- src/functions/pregenerated/func_jsoniq_functions.h 2013-08-09 10:23:10 +0000
+++ src/functions/pregenerated/func_jsoniq_functions.h 2013-08-12 12:50:29 +0000
@@ -287,6 +287,8 @@
287287
288 }288 }
289289
290 xqtref_t getReturnType(const fo_expr* caller) const;
291
290 bool propagatesInputNodes(expr* fo, csize producer) const { return false; }292 bool propagatesInputNodes(expr* fo, csize producer) const { return false; }
291293
292 bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }294 bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
@@ -329,21 +331,6 @@
329};331};
330332
331333
332//fn-jsoniq:is-null
333class fn_jsoniq_is_null : public function
334{
335public:
336 fn_jsoniq_is_null(const signature& sig, FunctionConsts::FunctionKind kind)
337 :
338 function(sig, kind)
339 {
340
341 }
342
343 CODEGEN_DECL();
344};
345
346
347//op-zorba:json-object-insert334//op-zorba:json-object-insert
348class op_zorba_json_object_insert : public function335class op_zorba_json_object_insert : public function
349{336{
350337
=== modified file 'src/functions/pregenerated/function_enum.h'
--- src/functions/pregenerated/function_enum.h 2013-08-09 10:23:10 +0000
+++ src/functions/pregenerated/function_enum.h 2013-08-12 12:50:29 +0000
@@ -271,7 +271,6 @@
271 FN_JSONIQ_SIZE_1,271 FN_JSONIQ_SIZE_1,
272 FN_JSONIQ_FLATTEN_1,272 FN_JSONIQ_FLATTEN_1,
273 FN_JSONIQ_NULL_0,273 FN_JSONIQ_NULL_0,
274 FN_JSONIQ_IS_NULL_1,
275 OP_ZORBA_JSON_OBJECT_INSERT_2,274 OP_ZORBA_JSON_OBJECT_INSERT_2,
276 OP_ZORBA_JSON_ARRAY_INSERT_3,275 OP_ZORBA_JSON_ARRAY_INSERT_3,
277 OP_ZORBA_JSON_DELETE_2,276 OP_ZORBA_JSON_DELETE_2,
278277
=== modified file 'src/runtime/json/jsoniq_functions_impl.cpp'
--- src/runtime/json/jsoniq_functions_impl.cpp 2013-08-09 10:23:10 +0000
+++ src/runtime/json/jsoniq_functions_impl.cpp 2013-08-12 12:50:29 +0000
@@ -1278,17 +1278,18 @@
1278 store::Item_t& result,1278 store::Item_t& result,
1279 PlanState& planState) const1279 PlanState& planState) const
1280{1280{
1281 store::Item_t lJSONItem;1281 store::Item_t item;
1282 xs_integer lSize;1282 xs_integer size;
12831283
1284 PlanIteratorState* state;1284 PlanIteratorState* state;
1285 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);1285 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
12861286
1287 consumeNext(lJSONItem, theChild.getp(), planState);1287 if (consumeNext(item, theChild.getp(), planState))
12881288 {
1289 lSize = lJSONItem->getArraySize();1289 size = item->getArraySize();
12901290
1291 STACK_PUSH(GENV_ITEMFACTORY->createInteger(result, lSize), state);1291 STACK_PUSH(GENV_ITEMFACTORY->createInteger(result, size), state);
1292 }
12921293
1293 STACK_END(state);1294 STACK_END(state);
1294}1295}
@@ -1516,6 +1517,7 @@
1516}1517}
15171518
15181519
1520#if 0
1519/*******************************************************************************1521/*******************************************************************************
1520 jn:is-null(xs:anyAtomicType) as xs:boolean1522 jn:is-null(xs:anyAtomicType) as xs:boolean
1521********************************************************************************/1523********************************************************************************/
@@ -1537,6 +1539,7 @@
15371539
1538 STACK_END(state);1540 STACK_END(state);
1539}1541}
1542#endif
15401543
15411544
1542/*******************************************************************************1545/*******************************************************************************
15431546
=== modified file 'src/runtime/json/pregenerated/jsoniq_functions.cpp'
--- src/runtime/json/pregenerated/jsoniq_functions.cpp 2013-06-18 18:55:33 +0000
+++ src/runtime/json/pregenerated/jsoniq_functions.cpp 2013-08-12 12:50:29 +0000
@@ -505,30 +505,6 @@
505// </JSONNullIterator>505// </JSONNullIterator>
506506
507507
508// <JSONIsNullIterator>
509SERIALIZABLE_CLASS_VERSIONS(JSONIsNullIterator)
510
511void JSONIsNullIterator::serialize(::zorba::serialization::Archiver& ar)
512{
513 serialize_baseclass(ar,
514 (UnaryBaseIterator<JSONIsNullIterator, PlanIteratorState>*)this);
515}
516
517
518void JSONIsNullIterator::accept(PlanIterVisitor& v) const
519{
520 v.beginVisit(*this);
521
522 theChild->accept(v);
523
524 v.endVisit(*this);
525}
526
527JSONIsNullIterator::~JSONIsNullIterator() {}
528
529// </JSONIsNullIterator>
530
531
532// <JSONObjectInsertIterator>508// <JSONObjectInsertIterator>
533SERIALIZABLE_CLASS_VERSIONS(JSONObjectInsertIterator)509SERIALIZABLE_CLASS_VERSIONS(JSONObjectInsertIterator)
534510
535511
=== modified file 'src/runtime/json/pregenerated/jsoniq_functions.h'
--- src/runtime/json/pregenerated/jsoniq_functions.h 2013-06-18 18:55:33 +0000
+++ src/runtime/json/pregenerated/jsoniq_functions.h 2013-08-12 12:50:29 +0000
@@ -655,36 +655,6 @@
655655
656/**656/**
657 * 657 *
658 * Author:
659 */
660class JSONIsNullIterator : public UnaryBaseIterator<JSONIsNullIterator, PlanIteratorState>
661{
662public:
663 SERIALIZABLE_CLASS(JSONIsNullIterator);
664
665 SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONIsNullIterator,
666 UnaryBaseIterator<JSONIsNullIterator, PlanIteratorState>);
667
668 void serialize( ::zorba::serialization::Archiver& ar);
669
670 JSONIsNullIterator(
671 static_context* sctx,
672 const QueryLoc& loc,
673 PlanIter_t& child)
674 :
675 UnaryBaseIterator<JSONIsNullIterator, PlanIteratorState>(sctx, loc, child)
676 {}
677
678 virtual ~JSONIsNullIterator();
679
680 void accept(PlanIterVisitor& v) const;
681
682 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
683};
684
685
686/**
687 *
688 * internal function658 * internal function
689 * 659 *
690 * Author: Zorba Team660 * Author: Zorba Team
691661
=== modified file 'src/runtime/pregenerated/iterator_enum.h'
--- src/runtime/pregenerated/iterator_enum.h 2013-07-26 21:05:40 +0000
+++ src/runtime/pregenerated/iterator_enum.h 2013-08-12 12:50:29 +0000
@@ -179,7 +179,6 @@
179 TYPE_JSONArraySizeIterator,179 TYPE_JSONArraySizeIterator,
180 TYPE_JSONArrayFlattenIterator,180 TYPE_JSONArrayFlattenIterator,
181 TYPE_JSONNullIterator,181 TYPE_JSONNullIterator,
182 TYPE_JSONIsNullIterator,
183 TYPE_JSONObjectInsertIterator,182 TYPE_JSONObjectInsertIterator,
184 TYPE_JSONArrayInsertIterator,183 TYPE_JSONArrayInsertIterator,
185 TYPE_JSONDeleteIterator,184 TYPE_JSONDeleteIterator,
186185
=== modified file 'src/runtime/spec/json/jsoniq_functions.xml'
--- src/runtime/spec/json/jsoniq_functions.xml 2013-08-09 10:23:10 +0000
+++ src/runtime/spec/json/jsoniq_functions.xml 2013-08-12 12:50:29 +0000
@@ -479,11 +479,12 @@
479479
480 <zorba:function isDeterministic="true">480 <zorba:function isDeterministic="true">
481 <zorba:signature localname="size" prefix="fn-jsoniq">481 <zorba:signature localname="size" prefix="fn-jsoniq">
482 <zorba:param>array()</zorba:param>482 <zorba:param>array()?</zorba:param>
483 <zorba:output>xs:integer</zorba:output>483 <zorba:output>xs:integer?</zorba:output>
484 </zorba:signature>484 </zorba:signature>
485485
486 <zorba:methods>486 <zorba:methods>
487 <zorba:getReturnType/>
487 <zorba:propagatesInputNodes value="false"/>488 <zorba:propagatesInputNodes value="false"/>
488 <zorba:mustCopyInputNodes value="false"/>489 <zorba:mustCopyInputNodes value="false"/>
489 </zorba:methods>490 </zorba:methods>
@@ -543,7 +544,6 @@
543<!--544<!--
544/*******************************************************************************545/*******************************************************************************
545********************************************************************************/546********************************************************************************/
546-->
547 <zorba:iterator name="JSONIsNullIterator" arity="unary">547 <zorba:iterator name="JSONIsNullIterator" arity="unary">
548548
549 <zorba:function isDeterministic="true">549 <zorba:function isDeterministic="true">
@@ -555,7 +555,7 @@
555 </zorba:function>555 </zorba:function>
556556
557 </zorba:iterator>557 </zorba:iterator>
558558-->
559559
560<!--560<!--
561/*******************************************************************************561/*******************************************************************************
562562
=== modified file 'src/runtime/visitors/pregenerated/planiter_visitor.h'
--- src/runtime/visitors/pregenerated/planiter_visitor.h 2013-07-26 21:05:40 +0000
+++ src/runtime/visitors/pregenerated/planiter_visitor.h 2013-08-12 12:50:29 +0000
@@ -364,8 +364,6 @@
364364
365 class JSONNullIterator;365 class JSONNullIterator;
366366
367 class JSONIsNullIterator;
368
369 class JSONObjectInsertIterator;367 class JSONObjectInsertIterator;
370368
371 class JSONArrayInsertIterator;369 class JSONArrayInsertIterator;
@@ -1252,9 +1250,6 @@
1252 virtual void beginVisit ( const JSONNullIterator& ) = 0;1250 virtual void beginVisit ( const JSONNullIterator& ) = 0;
1253 virtual void endVisit ( const JSONNullIterator& ) = 0;1251 virtual void endVisit ( const JSONNullIterator& ) = 0;
12541252
1255 virtual void beginVisit ( const JSONIsNullIterator& ) = 0;
1256 virtual void endVisit ( const JSONIsNullIterator& ) = 0;
1257
1258 virtual void beginVisit ( const JSONObjectInsertIterator& ) = 0;1253 virtual void beginVisit ( const JSONObjectInsertIterator& ) = 0;
1259 virtual void endVisit ( const JSONObjectInsertIterator& ) = 0;1254 virtual void endVisit ( const JSONObjectInsertIterator& ) = 0;
12601255
12611256
=== modified file 'src/runtime/visitors/pregenerated/printer_visitor.cpp'
--- src/runtime/visitors/pregenerated/printer_visitor.cpp 2013-08-05 11:54:06 +0000
+++ src/runtime/visitors/pregenerated/printer_visitor.cpp 2013-08-12 12:50:29 +0000
@@ -2220,20 +2220,6 @@
2220// </JSONNullIterator>2220// </JSONNullIterator>
22212221
22222222
2223// <JSONIsNullIterator>
2224void PrinterVisitor::beginVisit ( const JSONIsNullIterator& a) {
2225 thePrinter.startBeginVisit("JSONIsNullIterator", ++theId);
2226 printCommons( &a, theId );
2227 thePrinter.endBeginVisit( theId );
2228}
2229
2230void PrinterVisitor::endVisit ( const JSONIsNullIterator& ) {
2231 thePrinter.startEndVisit();
2232 thePrinter.endEndVisit();
2233}
2234// </JSONIsNullIterator>
2235
2236
2237// <JSONObjectInsertIterator>2223// <JSONObjectInsertIterator>
2238void PrinterVisitor::beginVisit ( const JSONObjectInsertIterator& a) {2224void PrinterVisitor::beginVisit ( const JSONObjectInsertIterator& a) {
2239 thePrinter.startBeginVisit("JSONObjectInsertIterator", ++theId);2225 thePrinter.startBeginVisit("JSONObjectInsertIterator", ++theId);
22402226
=== modified file 'src/runtime/visitors/pregenerated/printer_visitor.h'
--- src/runtime/visitors/pregenerated/printer_visitor.h 2013-07-26 21:05:40 +0000
+++ src/runtime/visitors/pregenerated/printer_visitor.h 2013-08-12 12:50:29 +0000
@@ -556,9 +556,6 @@
556 void beginVisit( const JSONNullIterator& );556 void beginVisit( const JSONNullIterator& );
557 void endVisit ( const JSONNullIterator& );557 void endVisit ( const JSONNullIterator& );
558558
559 void beginVisit( const JSONIsNullIterator& );
560 void endVisit ( const JSONIsNullIterator& );
561
562 void beginVisit( const JSONObjectInsertIterator& );559 void beginVisit( const JSONObjectInsertIterator& );
563 void endVisit ( const JSONObjectInsertIterator& );560 void endVisit ( const JSONObjectInsertIterator& );
564561
565562
=== modified file 'test/rbkt/Queries/zorba/jsoniq/null04.xq'
--- test/rbkt/Queries/zorba/jsoniq/null04.xq 2012-09-13 12:51:41 +0000
+++ test/rbkt/Queries/zorba/jsoniq/null04.xq 2013-08-12 12:50:29 +0000
@@ -1,2 +1,2 @@
1jn:is-null(jn:null())1jn:null() instance of js:null
22
33
=== modified file 'test/rbkt/Queries/zorba/jsoniq/null05.xq'
--- test/rbkt/Queries/zorba/jsoniq/null05.xq 2012-09-13 12:51:41 +0000
+++ test/rbkt/Queries/zorba/jsoniq/null05.xq 2013-08-12 12:50:29 +0000
@@ -1,2 +1,2 @@
1jn:is-null("null")1"null" instance of js:null
22

Subscribers

People subscribed via source and target branches