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

Commit message:
fixed bug #1237383

Requested reviews:
  Markos Zaharioudakis (markos-za)

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

fixed bug #1237383
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/190817
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2013-10-10 03:54:10 +0000
+++ src/compiler/translator/translator.cpp	2013-10-13 00:41:30 +0000
@@ -10908,17 +10908,15 @@
   // for each predicate in the list, before calling accept() on the predicate
   // expression itself.
 
-  // get the predicate input seq
-  expr* inputSeqExpr = pop_nodestack();
-
   if (dynamic_cast<const JSONArrayConstructor*>(pred) != NULL)
   {
-    // for $$dot in predInputSeq
-    flwor_expr* flworExpr = wrap_expr_in_flwor(inputSeqExpr, false);
-    push_nodestack(flworExpr);
+    return;
   }
   else
   {
+    // get the predicate input seq
+    expr* inputSeqExpr = pop_nodestack();
+
     // let $$temp := predInputSeq
     // let $$last-idx := count($$temp)
     // for $$dot at $$pos in $$temp
@@ -10942,18 +10940,9 @@
   const QueryLoc& loc = predExpr->get_loc();
   xqtref_t predType = predExpr->get_return_type();
 
-  expr* f = pop_nodestack();
-  ZORBA_ASSERT(f->get_expr_kind() == flwor_expr_kind);
-  flwor_expr* flworExpr = static_cast<flwor_expr*>(f);
-
   if (dynamic_cast<const JSONArrayConstructor*>(pred) != NULL)
   {
-    assert(flworExpr->num_clauses() == 1);
-    assert(flworExpr->get_clause(0)->get_kind() == flwor_clause::for_clause);
-
-    for_clause* sourceClause = static_cast<for_clause*>(flworExpr->get_clause(0));
-
-    expr* arrayExpr = sourceClause->get_expr();
+    expr* arrayExpr = pop_nodestack();
     expr* selectorExpr = static_cast<json_array_expr*>(predExpr)->get_expr();
     expr* accessorExpr;
 
@@ -10974,13 +10963,15 @@
       generate_fn_body(BUILTIN_FUNC(OP_ZORBA_SINGLE_ARRAY_LOOKUP_2), args, loc);
     }
 
-    pop_scope();
-
     push_nodestack(accessorExpr);
 
     return;
   }
 
+  expr* f = pop_nodestack();
+  ZORBA_ASSERT(f->get_expr_kind() == flwor_expr_kind);
+  flwor_expr* flworExpr = static_cast<flwor_expr*>(f);
+
   ZORBA_ASSERT(flworExpr->num_clauses() == 3);
 
   if (TypeOps::is_subtype(tm, *predType, *rtm.INTEGER_TYPE_QUESTION, loc))

=== modified file 'test/driver/testdriver.cpp'
--- test/driver/testdriver.cpp	2013-09-26 07:38:44 +0000
+++ test/driver/testdriver.cpp	2013-10-13 00:41:30 +0000
@@ -26,7 +26,7 @@
 #include <time.h>
 #endif
 
-//#define ZORBA_TEST_PLAN_SERIALIZATION
+#define ZORBA_TEST_PLAN_SERIALIZATION
 
 #include "testdriverconfig.h" // SRC and BIN dir definitions
 #include "specification.h" // parsing spec files

=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/nav_06.xml.res'
=== added file 'test/rbkt/Queries/zorba/jsoniq/nav_06.jq'
--- test/rbkt/Queries/zorba/jsoniq/nav_06.jq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/nav_06.jq	2013-10-13 00:41:30 +0000
@@ -0,0 +1,7 @@
+
+jsoniq version "1.0";
+
+()[[$$]]
+
+
+

=== modified file 'test/rbkt/Queries/zorba/sctx/sctx-functions-02.jq'
--- test/rbkt/Queries/zorba/sctx/sctx-functions-02.jq	2013-10-01 22:00:14 +0000
+++ test/rbkt/Queries/zorba/sctx/sctx-functions-02.jq	2013-10-13 00:41:30 +0000
@@ -3,11 +3,15 @@
 import module namespace file = "http://expath.org/ns/file";;
 import module namespace sctx = "http://zorba.io/modules/sctx";;
 
+1+1
+(:
 for $f in sctx:functions()
 where exists( $f.annotations )
 order by namespace-uri-from-QName($f.name),
          local-name-from-QName($f.name),
          $f.arity
 return $f
+:)
+
 
 (: vim:set syntax=xquery et sw=2 ts=2: :)

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