Merge lp:~zorba-coders/zorba/hof-next into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11348
Merged at revision: 11387
Proposed branch: lp:~zorba-coders/zorba/hof-next
Merge into: lp:zorba
Diff against target: 120 lines (+23/-19)
4 files modified
src/compiler/translator/translator.cpp (+15/-10)
src/runtime/core/sequencetypes.cpp (+3/-3)
src/store/naive/node_iterators.cpp (+5/-5)
test/fots/CMakeLists.txt (+0/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/hof-next
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+159569@code.launchpad.net

Commit message

1. Fixed bug concerning the raising of XPTY0018 in the presence of function items.
2. hof optimization: avoid function coersion if possible.

Description of the change

1. Fixed bug concerning the raising of XPTY0018 in the presence of function items.
2. hof optimization: avoid function coersion if possible.

To post a comment you must log in.
lp:~zorba-coders/zorba/hof-next updated
11348. By Markos Zaharioudakis

merge from trunk

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job hof-next-2013-04-18T09-36-45.796Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp 2013-04-16 20:06:08 +0000
+++ src/compiler/translator/translator.cpp 2013-04-18 08:59:30 +0000
@@ -1506,16 +1506,21 @@
1506 }1506 }
1507 else if (paramType->type_kind() == XQType::FUNCTION_TYPE_KIND)1507 else if (paramType->type_kind() == XQType::FUNCTION_TYPE_KIND)
1508 {1508 {
1509 // function coercion1509 xqtref_t argType = argExpr->get_return_type();
1510 argExpr = wrap_in_coercion(paramType, argExpr, loc);1510
15111511 if (!TypeOps::is_subtype(tm, *argType, *paramType, loc))
1512 xqtref_t cardType = tm->create_any_item_type(paramType->get_quantifier());1512 {
15131513 // function coercion
1514 argExpr = wrap_in_type_match(argExpr,1514 argExpr = wrap_in_coercion(paramType, argExpr, loc);
1515 cardType,1515
1516 loc,1516 xqtref_t cardType = tm->create_any_item_type(paramType->get_quantifier());
1517 TREAT_FUNC_PARAM,1517
1518 func->getName());1518 argExpr = wrap_in_type_match(argExpr,
1519 cardType,
1520 loc,
1521 TREAT_FUNC_PARAM,
1522 func->getName());
1523 }
1519 }1524 }
1520 else1525 else
1521 {1526 {
15221527
=== modified file 'src/runtime/core/sequencetypes.cpp'
--- src/runtime/core/sequencetypes.cpp 2013-04-08 19:44:58 +0000
+++ src/runtime/core/sequencetypes.cpp 2013-04-18 08:59:30 +0000
@@ -813,16 +813,16 @@
813813
814 if (CONSUME(result, 0))814 if (CONSUME(result, 0))
815 {815 {
816 state->atomics = result->isAtomic();816 state->atomics = !result->isNode();
817817
818 STACK_PUSH(true, state);818 STACK_PUSH(true, state);
819819
820 while (CONSUME(result, 0))820 while (CONSUME(result, 0))
821 {821 {
822 if (state->atomics != result->isAtomic())822 if (state->atomics == result->isNode())
823 throw XQUERY_EXCEPTION(err::XPTY0018, ERROR_LOC(loc));823 throw XQUERY_EXCEPTION(err::XPTY0018, ERROR_LOC(loc));
824824
825 STACK_PUSH (true, state);825 STACK_PUSH(true, state);
826 }826 }
827 }827 }
828828
829829
=== modified file 'src/store/naive/node_iterators.cpp'
--- src/store/naive/node_iterators.cpp 2013-02-07 17:24:36 +0000
+++ src/store/naive/node_iterators.cpp 2013-04-18 08:59:30 +0000
@@ -207,7 +207,7 @@
207 if (!theInput->next(result))207 if (!theInput->next(result))
208 return false;208 return false;
209209
210 if (!result->isAtomic())210 if (result->isNode())
211 throw XQUERY_EXCEPTION(err::XPTY0018);211 throw XQUERY_EXCEPTION(err::XPTY0018);
212212
213 return true;213 return true;
@@ -216,7 +216,7 @@
216 if (!theInput->next(result))216 if (!theInput->next(result))
217 return false;217 return false;
218218
219 if (result->isAtomic())219 if (!result->isNode())
220 {220 {
221 if (theNodeMode)221 if (theNodeMode)
222 throw XQUERY_EXCEPTION(err::XPTY0018);222 throw XQUERY_EXCEPTION(err::XPTY0018);
@@ -236,7 +236,7 @@
236 if (!theInput->next(result))236 if (!theInput->next(result))
237 return false;237 return false;
238238
239 if (result->isAtomic())239 if (!result->isNode())
240 throw XQUERY_EXCEPTION(err::XPTY0018);240 throw XQUERY_EXCEPTION(err::XPTY0018);
241 }241 }
242 }242 }
@@ -404,7 +404,7 @@
404 if (!theInput->next(result))404 if (!theInput->next(result))
405 return false;405 return false;
406406
407 if (!result->isAtomic())407 if (result->isNode())
408 throw XQUERY_EXCEPTION(err::XPTY0018);408 throw XQUERY_EXCEPTION(err::XPTY0018);
409409
410 return true;410 return true;
@@ -417,7 +417,7 @@
417 if (!theInput->next(result))417 if (!theInput->next(result))
418 break;418 break;
419419
420 if (result->isAtomic() || result->isFunction())420 if (!result->isNode())
421 {421 {
422 if (theNodeMode)422 if (theNodeMode)
423 throw XQUERY_EXCEPTION(err::XPTY0018);423 throw XQUERY_EXCEPTION(err::XPTY0018);
424424
=== modified file 'test/fots/CMakeLists.txt'
--- test/fots/CMakeLists.txt 2013-04-17 22:01:55 +0000
+++ test/fots/CMakeLists.txt 2013-04-18 08:59:30 +0000
@@ -465,7 +465,6 @@
465EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-404 0)465EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-404 0)
466EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-494 0)466EXPECTED_FOTS_FAILURE (fn-function-lookup fn-function-lookup-494 0)
467EXPECTED_FOTS_FAILURE (fn-map-pairs fn-map-pairs-026 0)467EXPECTED_FOTS_FAILURE (fn-map-pairs fn-map-pairs-026 0)
468EXPECTED_FOTS_FAILURE (misc-HigherOrderFunctions hof-036 0)
469EXPECTED_FOTS_FAILURE (misc-HigherOrderFunctions xqhof12 0)468EXPECTED_FOTS_FAILURE (misc-HigherOrderFunctions xqhof12 0)
470EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-062 0)469EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-062 0)
471EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-494 0)470EXPECTED_FOTS_FAILURE (prod-NamedFunctionRef function-literal-494 0)

Subscribers

People subscribed via source and target branches