Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba
- markos-scratch
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Markos Zaharioudakis |
Approved revision: | 11005 |
Merged at revision: | 11165 |
Proposed branch: | lp:~zorba-coders/zorba/markos-scratch |
Merge into: | lp:zorba |
Diff against target: |
1979 lines (+372/-342) 36 files modified
ChangeLog (+1/-0) include/zorba/pregenerated/diagnostic_list.h (+1/-1) modules/xqxq/xqxq.xq.src/xqxq.cpp (+1/-1) src/api/dynamiccontextimpl.cpp (+5/-4) src/api/xqueryimpl.cpp (+2/-3) src/compiler/parsetree/parsenodes.cpp (+35/-9) src/compiler/parsetree/parsenodes.h (+4/-3) src/compiler/rewriter/rules/fold_rules.cpp (+1/-1) src/compiler/translator/prolog_graph.cpp (+1/-1) src/compiler/translator/translator.cpp (+120/-133) src/context/dynamic_context.cpp (+5/-5) src/context/namespace_context.cpp (+1/-1) src/context/root_static_context.cpp (+1/-1) src/context/static_context.cpp (+35/-24) src/context/static_context.h (+3/-4) src/diagnostics/diagnostic_en.xml (+29/-25) src/diagnostics/pregenerated/diagnostic_list.cpp (+1/-1) src/diagnostics/pregenerated/dict_en.cpp (+10/-9) src/diagnostics/pregenerated/dict_zed_keys.h (+6/-5) src/runtime/core/var_iterators.cpp (+4/-4) src/runtime/eval/eval.cpp (+1/-1) src/runtime/introspection/sctx_impl.cpp (+1/-1) src/runtime/numerics/numerics_impl.cpp (+13/-6) src/store/naive/node_items.cpp (+6/-2) src/store/naive/node_items.h (+4/-1) src/store/naive/pul_primitives.cpp (+19/-16) src/store/naive/simple_pul.cpp (+15/-16) src/types/casting.cpp (+2/-2) src/types/schema/revalidateUtils.cpp (+2/-1) src/types/schema/schema.cpp (+8/-20) src/types/typeimpl.cpp (+1/-1) src/types/typemanager.h (+2/-2) src/types/typemanagerimpl.cpp (+25/-33) src/types/typemanagerimpl.h (+2/-2) src/types/typeops.cpp (+3/-3) test/rbkt/Queries/zorba/modules/mainModule16.xq (+2/-0) |
To merge this branch: | bzr merge lp:~zorba-coders/zorba/markos-scratch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Markos Zaharioudakis | Approve | ||
Review via email: mp+142262@code.launchpad.net |
Commit message
Fixed bug #1043294 (XQST0036 not used in XQuery 3.0).
Partial fixes for bug #867008.
Description of the change
Fixed bug #1043294 (XQST0036 not used in XQuery 3.0).
Partial fixes for bug #867008
Markos Zaharioudakis (markos-za) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job markos-
The final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
- 11005. By Markos Zaharioudakis
-
Fixed bug #1043294 (XQST0036 not used in XQuery 3.0). Partial fixes for bug #867008.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job markos-
All tests succeeded!
Preview Diff
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2013-01-08 02:37:32 +0000 | |||
3 | +++ ChangeLog 2013-01-08 11:10:56 +0000 | |||
4 | @@ -46,6 +46,7 @@ | |||
5 | 46 | * Fixed bug #1070551 (zerr:ZOSE0003 stream read failure) | 46 | * Fixed bug #1070551 (zerr:ZOSE0003 stream read failure) |
6 | 47 | * Fixed bug #992304 (Compiling library modules could load data from wrong | 47 | * Fixed bug #992304 (Compiling library modules could load data from wrong |
7 | 48 | source) | 48 | source) |
8 | 49 | * Fixed bug #1043294 (XQST0036 not used in XQuery 3.0). | ||
9 | 49 | * Fixed bugs related to casting to user-defined types. | 50 | * Fixed bugs related to casting to user-defined types. |
10 | 50 | 51 | ||
11 | 51 | 52 | ||
12 | 52 | 53 | ||
13 | === modified file 'include/zorba/pregenerated/diagnostic_list.h' | |||
14 | --- include/zorba/pregenerated/diagnostic_list.h 2012-12-21 22:05:39 +0000 | |||
15 | +++ include/zorba/pregenerated/diagnostic_list.h 2013-01-08 11:10:56 +0000 | |||
16 | @@ -492,7 +492,7 @@ | |||
17 | 492 | 492 | ||
18 | 493 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0009_XQUERY_NOT_COMPILED_IN_DEBUG_MODE; | 493 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0009_XQUERY_NOT_COMPILED_IN_DEBUG_MODE; |
19 | 494 | 494 | ||
21 | 495 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0011_ELEMENT_NOT_DECLARED; | 495 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0011_VARIABLE_NOT_DECLARED; |
22 | 496 | 496 | ||
23 | 497 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0014_INVALID_ARGUMENT; | 497 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0014_INVALID_ARGUMENT; |
24 | 498 | 498 | ||
25 | 499 | 499 | ||
26 | === modified file 'modules/xqxq/xqxq.xq.src/xqxq.cpp' | |||
27 | --- modules/xqxq/xqxq.xq.src/xqxq.cpp 2012-11-20 04:43:01 +0000 | |||
28 | +++ modules/xqxq/xqxq.xq.src/xqxq.cpp 2013-01-08 11:10:56 +0000 | |||
29 | @@ -609,7 +609,7 @@ | |||
30 | 609 | } | 609 | } |
31 | 610 | catch (ZorbaException& ze) | 610 | catch (ZorbaException& ze) |
32 | 611 | { | 611 | { |
34 | 612 | if (ze.diagnostic() == zerr::ZAPI0011_ELEMENT_NOT_DECLARED) | 612 | if (ze.diagnostic() == zerr::ZAPI0011_VARIABLE_NOT_DECLARED) |
35 | 613 | XQXQFunction::throwError("UndeclaredVariable", ze.what()); | 613 | XQXQFunction::throwError("UndeclaredVariable", ze.what()); |
36 | 614 | throw; // should not happen | 614 | throw; // should not happen |
37 | 615 | } | 615 | } |
38 | 616 | 616 | ||
39 | === modified file 'src/api/dynamiccontextimpl.cpp' | |||
40 | --- src/api/dynamiccontextimpl.cpp 2012-12-21 05:13:20 +0000 | |||
41 | +++ src/api/dynamiccontextimpl.cpp 2013-01-08 11:10:56 +0000 | |||
42 | @@ -129,11 +129,11 @@ | |||
43 | 129 | if (!var) | 129 | if (!var) |
44 | 130 | { | 130 | { |
45 | 131 | throw XQUERY_EXCEPTION(err::XPST0008, | 131 | throw XQUERY_EXCEPTION(err::XPST0008, |
47 | 132 | ERROR_PARAMS(BUILD_STRING('{', | 132 | ERROR_PARAMS(ZED(XPST0008_VariableName_2), |
48 | 133 | BUILD_STRING('{', | ||
49 | 133 | qnameItem->getNamespace(), | 134 | qnameItem->getNamespace(), |
50 | 134 | '}', | 135 | '}', |
53 | 135 | qnameItem->getLocalName()), | 136 | qnameItem->getLocalName()))); |
52 | 136 | ZED(Variable))); | ||
54 | 137 | } | 137 | } |
55 | 138 | 138 | ||
56 | 139 | return var; | 139 | return var; |
57 | @@ -177,7 +177,8 @@ | |||
58 | 177 | if (!var) | 177 | if (!var) |
59 | 178 | { | 178 | { |
60 | 179 | throw XQUERY_EXCEPTION(err::XPST0008, | 179 | throw XQUERY_EXCEPTION(err::XPST0008, |
62 | 180 | ERROR_PARAMS(BUILD_STRING('{', inVarUri, '}', inVarLocalName ), ZED(Variable))); | 180 | ERROR_PARAMS(ZED(XPST0008_VariableName_2), |
63 | 181 | BUILD_STRING('{', inVarUri, '}', inVarLocalName ))); | ||
64 | 181 | } | 182 | } |
65 | 182 | 183 | ||
66 | 183 | return var; | 184 | return var; |
67 | 184 | 185 | ||
68 | === modified file 'src/api/xqueryimpl.cpp' | |||
69 | --- src/api/xqueryimpl.cpp 2012-10-08 12:09:36 +0000 | |||
70 | +++ src/api/xqueryimpl.cpp 2013-01-08 11:10:56 +0000 | |||
71 | @@ -848,12 +848,11 @@ | |||
72 | 848 | 848 | ||
73 | 849 | if (!var) | 849 | if (!var) |
74 | 850 | { | 850 | { |
76 | 851 | throw XQUERY_EXCEPTION(zerr::ZAPI0011_ELEMENT_NOT_DECLARED, | 851 | throw XQUERY_EXCEPTION(zerr::ZAPI0011_VARIABLE_NOT_DECLARED, |
77 | 852 | ERROR_PARAMS(BUILD_STRING('{', | 852 | ERROR_PARAMS(BUILD_STRING('{', |
78 | 853 | qname->getNamespace(), | 853 | qname->getNamespace(), |
79 | 854 | '}', | 854 | '}', |
82 | 855 | qname->getLocalName()), | 855 | qname->getLocalName()))); |
81 | 856 | ZED(Variable))); | ||
83 | 857 | } | 856 | } |
84 | 858 | 857 | ||
85 | 859 | if (var->hasInitializer()) | 858 | if (var->hasInitializer()) |
86 | 860 | 859 | ||
87 | === modified file 'src/compiler/parsetree/parsenodes.cpp' | |||
88 | --- src/compiler/parsetree/parsenodes.cpp 2012-12-18 15:57:51 +0000 | |||
89 | +++ src/compiler/parsetree/parsenodes.cpp 2013-01-08 11:10:56 +0000 | |||
90 | @@ -17,6 +17,7 @@ | |||
91 | 17 | 17 | ||
92 | 18 | #include "util/stl_util.h" | 18 | #include "util/stl_util.h" |
93 | 19 | #include "diagnostics/assert.h" | 19 | #include "diagnostics/assert.h" |
94 | 20 | #include "diagnostics/util_macros.h" | ||
95 | 20 | #include "diagnostics/xquery_diagnostics.h" | 21 | #include "diagnostics/xquery_diagnostics.h" |
96 | 21 | 22 | ||
97 | 22 | #include "types/typemanager.h" | 23 | #include "types/typemanager.h" |
98 | @@ -3644,20 +3645,23 @@ | |||
99 | 3644 | dir_content_hv.rbegin(); | 3645 | dir_content_hv.rbegin(); |
100 | 3645 | 3646 | ||
101 | 3646 | const DirElemContent* lPrev = 0; | 3647 | const DirElemContent* lPrev = 0; |
104 | 3647 | // To find out if a DirElemContent is boundary whitespace, the current item cannot be accepted till | 3648 | // To find out if a DirElemContent is boundary whitespace, the current item |
105 | 3648 | // the next item (relative to the current item) is passed to check_boundary_whitespace. | 3649 | // cannot be accepted till the next item (relative to the current item) is |
106 | 3650 | // passed to check_boundary_whitespace. | ||
107 | 3649 | v.begin_check_boundary_whitespace(); | 3651 | v.begin_check_boundary_whitespace(); |
109 | 3650 | for (; it!=dir_content_hv.rend(); ++it) | 3652 | for (; it != dir_content_hv.rend(); ++it) |
110 | 3651 | { | 3653 | { |
111 | 3652 | const DirElemContent* e_p = &**it; | 3654 | const DirElemContent* e_p = &**it; |
112 | 3653 | v.check_boundary_whitespace (*e_p); | 3655 | v.check_boundary_whitespace (*e_p); |
114 | 3654 | if (lPrev != 0) { | 3656 | if (lPrev != 0) |
115 | 3657 | { | ||
116 | 3655 | ACCEPT_CHK(lPrev); | 3658 | ACCEPT_CHK(lPrev); |
117 | 3656 | } | 3659 | } |
118 | 3657 | lPrev = e_p; | 3660 | lPrev = e_p; |
119 | 3658 | } | 3661 | } |
120 | 3659 | v.end_check_boundary_whitespace(); | 3662 | v.end_check_boundary_whitespace(); |
122 | 3660 | if (lPrev != 0) { | 3663 | if (lPrev != 0) |
123 | 3664 | { | ||
124 | 3661 | ACCEPT_CHK(lPrev); | 3665 | ACCEPT_CHK(lPrev); |
125 | 3662 | } | 3666 | } |
126 | 3663 | END_VISITOR(); | 3667 | END_VISITOR(); |
127 | @@ -3666,11 +3670,33 @@ | |||
128 | 3666 | 3670 | ||
129 | 3667 | // [97] DirAttributeList | 3671 | // [97] DirAttributeList |
130 | 3668 | 3672 | ||
134 | 3669 | DirAttributeList::DirAttributeList( | 3673 | DirAttributeList::DirAttributeList(const QueryLoc& loc) |
135 | 3670 | const QueryLoc& loc) | 3674 | : |
133 | 3671 | : | ||
136 | 3672 | parsenode(loc) | 3675 | parsenode(loc) |
138 | 3673 | {} | 3676 | { |
139 | 3677 | } | ||
140 | 3678 | |||
141 | 3679 | |||
142 | 3680 | void DirAttributeList::push_back(rchandle<DirAttr> attr) | ||
143 | 3681 | { | ||
144 | 3682 | const QName* qname = attr->get_name(); | ||
145 | 3683 | |||
146 | 3684 | if (qname->get_qname() == "xmlns" || qname->get_prefix() == "xmlns") | ||
147 | 3685 | { | ||
148 | 3686 | std::vector<rchandle<DirAttr> >::const_iterator ite = theAttributes.begin(); | ||
149 | 3687 | std::vector<rchandle<DirAttr> >::const_iterator end = theAttributes.end(); | ||
150 | 3688 | for (; ite != end; ++ite) | ||
151 | 3689 | { | ||
152 | 3690 | if (*((*ite)->get_name()) == *(qname)) | ||
153 | 3691 | { | ||
154 | 3692 | RAISE_ERROR(err::XQST0071, attr->get_location(), | ||
155 | 3693 | ERROR_PARAMS(attr->get_name()->get_qname())); | ||
156 | 3694 | } | ||
157 | 3695 | } | ||
158 | 3696 | } | ||
159 | 3697 | |||
160 | 3698 | theAttributes.push_back(attr); | ||
161 | 3699 | } | ||
162 | 3674 | 3700 | ||
163 | 3675 | 3701 | ||
164 | 3676 | void DirAttributeList::accept( parsenode_visitor &v ) const | 3702 | void DirAttributeList::accept( parsenode_visitor &v ) const |
165 | 3677 | 3703 | ||
166 | === modified file 'src/compiler/parsetree/parsenodes.h' | |||
167 | --- src/compiler/parsetree/parsenodes.h 2012-12-21 22:05:39 +0000 | |||
168 | +++ src/compiler/parsetree/parsenodes.h 2013-01-08 11:10:56 +0000 | |||
169 | @@ -4358,13 +4358,13 @@ | |||
170 | 4358 | public: | 4358 | public: |
171 | 4359 | DirAttributeList(const QueryLoc&); | 4359 | DirAttributeList(const QueryLoc&); |
172 | 4360 | 4360 | ||
174 | 4361 | void push_back(rchandle<DirAttr> attr) { theAttributes.push_back(attr); } | 4361 | void push_back(rchandle<DirAttr> attr); |
175 | 4362 | 4362 | ||
176 | 4363 | rchandle<DirAttr> operator[](int i) { return theAttributes[i]; } | 4363 | rchandle<DirAttr> operator[](int i) { return theAttributes[i]; } |
177 | 4364 | 4364 | ||
179 | 4365 | const DirAttr *operator[] (int i) const { return theAttributes[i]; } | 4365 | const DirAttr* operator[](int i) const { return theAttributes[i]; } |
180 | 4366 | 4366 | ||
182 | 4367 | ulong size () const { return (ulong)theAttributes.size (); } | 4367 | csize size() const { return theAttributes.size(); } |
183 | 4368 | 4368 | ||
184 | 4369 | void accept(parsenode_visitor&) const; | 4369 | void accept(parsenode_visitor&) const; |
185 | 4370 | }; | 4370 | }; |
186 | @@ -4388,6 +4388,7 @@ | |||
187 | 4388 | 4388 | ||
188 | 4389 | public: | 4389 | public: |
189 | 4390 | rchandle<QName> get_name() const { return theName; } | 4390 | rchandle<QName> get_name() const { return theName; } |
190 | 4391 | |||
191 | 4391 | rchandle<DirAttributeValue> get_value() const { return theValue; } | 4392 | rchandle<DirAttributeValue> get_value() const { return theValue; } |
192 | 4392 | 4393 | ||
193 | 4393 | public: | 4394 | public: |
194 | 4394 | 4395 | ||
195 | === modified file 'src/compiler/rewriter/rules/fold_rules.cpp' | |||
196 | --- src/compiler/rewriter/rules/fold_rules.cpp 2012-11-12 17:12:41 +0000 | |||
197 | +++ src/compiler/rewriter/rules/fold_rules.cpp 2013-01-08 11:10:56 +0000 | |||
198 | @@ -894,7 +894,7 @@ | |||
199 | 894 | *tm->create_named_type(val->getType(), | 894 | *tm->create_named_type(val->getType(), |
200 | 895 | TypeConstants::QUANT_ONE, | 895 | TypeConstants::QUANT_ONE, |
201 | 896 | fo.get_loc(), | 896 | fo.get_loc(), |
203 | 897 | err::XPTY0004), | 897 | true), |
204 | 898 | *rtm.INTEGER_TYPE_ONE, | 898 | *rtm.INTEGER_TYPE_ONE, |
205 | 899 | fo.get_loc())) | 899 | fo.get_loc())) |
206 | 900 | { | 900 | { |
207 | 901 | 901 | ||
208 | === modified file 'src/compiler/translator/prolog_graph.cpp' | |||
209 | --- src/compiler/translator/prolog_graph.cpp 2012-09-19 21:16:15 +0000 | |||
210 | +++ src/compiler/translator/prolog_graph.cpp 2013-01-08 11:10:56 +0000 | |||
211 | @@ -55,7 +55,7 @@ | |||
212 | 55 | zstring varName = '$' + v1.getVarExpr()->get_name()->getStringValue(); | 55 | zstring varName = '$' + v1.getVarExpr()->get_name()->getStringValue(); |
213 | 56 | 56 | ||
214 | 57 | RAISE_ERROR(err::XPST0008, v2.getVarExpr()->get_loc(), | 57 | RAISE_ERROR(err::XPST0008, v2.getVarExpr()->get_loc(), |
216 | 58 | ERROR_PARAMS(varName, ZED(VariabledUndeclared))); | 58 | ERROR_PARAMS(ZED(XPST0008_VariableName_2), varName)); |
217 | 59 | } | 59 | } |
218 | 60 | 60 | ||
219 | 61 | addEdge(theGraph, v1, v2); | 61 | addEdge(theGraph, v1, v2); |
220 | 62 | 62 | ||
221 | === modified file 'src/compiler/translator/translator.cpp' | |||
222 | --- src/compiler/translator/translator.cpp 2012-12-28 10:24:59 +0000 | |||
223 | +++ src/compiler/translator/translator.cpp 2013-01-08 11:10:56 +0000 | |||
224 | @@ -1149,27 +1149,7 @@ | |||
225 | 1149 | { | 1149 | { |
226 | 1150 | assert(sctx != NULL); | 1150 | assert(sctx != NULL); |
227 | 1151 | 1151 | ||
249 | 1152 | switch (e->get_kind()) | 1152 | sctx->bind_var(e, e->get_loc()); |
229 | 1153 | { | ||
230 | 1154 | case var_expr::let_var: | ||
231 | 1155 | { | ||
232 | 1156 | sctx->bind_var(e, e->get_loc(), err::XQST0039); | ||
233 | 1157 | break; | ||
234 | 1158 | } | ||
235 | 1159 | case var_expr::win_var: | ||
236 | 1160 | case var_expr::wincond_out_var: | ||
237 | 1161 | case var_expr::wincond_out_pos_var: | ||
238 | 1162 | case var_expr::wincond_in_var: | ||
239 | 1163 | case var_expr::wincond_in_pos_var: | ||
240 | 1164 | { | ||
241 | 1165 | sctx->bind_var(e, e->get_loc(), err::XQST0103); | ||
242 | 1166 | break; | ||
243 | 1167 | } | ||
244 | 1168 | default: | ||
245 | 1169 | { | ||
246 | 1170 | sctx->bind_var(e, e->get_loc(), err::XQST0049); | ||
247 | 1171 | } | ||
248 | 1172 | } | ||
250 | 1173 | } | 1153 | } |
251 | 1174 | 1154 | ||
252 | 1175 | 1155 | ||
253 | @@ -1221,26 +1201,27 @@ | |||
254 | 1221 | ********************************************************************************/ | 1201 | ********************************************************************************/ |
255 | 1222 | var_expr* lookup_ctx_var(const QName* qname, const QueryLoc& loc) | 1202 | var_expr* lookup_ctx_var(const QName* qname, const QueryLoc& loc) |
256 | 1223 | { | 1203 | { |
277 | 1224 | if (theIsInIndexDomain) | 1204 | store::Item_t qnameItem; |
278 | 1225 | { | 1205 | expand_no_default_qname(qnameItem, qname, loc); |
279 | 1226 | try | 1206 | |
280 | 1227 | { | 1207 | VarInfo* var = theSctx->lookup_var(qnameItem.getp()); |
281 | 1228 | return lookup_var(qname, loc, err::XPDY0002); | 1208 | |
282 | 1229 | } | 1209 | if (var == NULL) |
283 | 1230 | catch (ZorbaException const& e) | 1210 | { |
284 | 1231 | { | 1211 | if (theIsInIndexDomain) |
285 | 1232 | if (e.diagnostic() == err::XPDY0002) | 1212 | { |
286 | 1233 | { | 1213 | RAISE_ERROR(zerr::ZDST0032_INDEX_REFERENCES_CTX_ITEM, loc, |
287 | 1234 | RAISE_ERROR(zerr::ZDST0032_INDEX_REFERENCES_CTX_ITEM, loc, | 1214 | ERROR_PARAMS(theIndexDecl->getName()->getStringValue())); |
288 | 1235 | ERROR_PARAMS(theIndexDecl->getName()->getStringValue())); | 1215 | } |
289 | 1236 | } | 1216 | else |
290 | 1237 | throw; | 1217 | { |
291 | 1238 | } | 1218 | zstring varName = static_context::var_name(qnameItem); |
292 | 1239 | } | 1219 | RAISE_ERROR(err::XPDY0002, loc, |
293 | 1240 | else | 1220 | ERROR_PARAMS(ZED(XPDY0002_ContextUndeclared_2), varName)); |
294 | 1241 | { | 1221 | } |
295 | 1242 | return lookup_var(qname, loc, err::XPDY0002); | 1222 | } |
296 | 1243 | } | 1223 | |
297 | 1224 | return var->getVar(); | ||
298 | 1244 | } | 1225 | } |
299 | 1245 | 1226 | ||
300 | 1246 | 1227 | ||
301 | @@ -1252,10 +1233,10 @@ | |||
302 | 1252 | If the lexical qname has a prefix for which no namespace binding exists, the | 1233 | If the lexical qname has a prefix for which no namespace binding exists, the |
303 | 1253 | method raises error. | 1234 | method raises error. |
304 | 1254 | 1235 | ||
307 | 1255 | If var is not found, the method raises the given error, unless the given error | 1236 | If var is not found, the method raises XPST0008, unless the raiseError param |
308 | 1256 | is zerr::ZXQP0000_NO_ERROR, in which case it returns NULL. | 1237 | is alse, in which case it returns NULL. |
309 | 1257 | ********************************************************************************/ | 1238 | ********************************************************************************/ |
311 | 1258 | var_expr* lookup_var(const QName* qname, const QueryLoc& loc, const Error& err) | 1239 | var_expr* lookup_var(const QName* qname, const QueryLoc& loc, bool raiseError) |
312 | 1259 | { | 1240 | { |
313 | 1260 | store::Item_t qnameItem; | 1241 | store::Item_t qnameItem; |
314 | 1261 | expand_no_default_qname(qnameItem, qname, loc); | 1242 | expand_no_default_qname(qnameItem, qname, loc); |
315 | @@ -1264,12 +1245,11 @@ | |||
316 | 1264 | 1245 | ||
317 | 1265 | if (!var) | 1246 | if (!var) |
318 | 1266 | { | 1247 | { |
320 | 1267 | if (err != zerr::ZXQP0000_NO_ERROR) | 1248 | if (raiseError) |
321 | 1268 | { | 1249 | { |
322 | 1269 | zstring varName = static_context::var_name(qnameItem); | 1250 | zstring varName = static_context::var_name(qnameItem); |
326 | 1270 | throw XQUERY_EXCEPTION_VAR(err, | 1251 | RAISE_ERROR(err::XPST0008, loc, |
327 | 1271 | ERROR_PARAMS(varName, ZED(VariabledUndeclared)), | 1252 | ERROR_PARAMS(ZED(XPST0008_VariableName_2), varName)); |
325 | 1272 | ERROR_LOC(loc)); | ||
328 | 1273 | } | 1253 | } |
329 | 1274 | 1254 | ||
330 | 1275 | return NULL; | 1255 | return NULL; |
331 | @@ -1284,21 +1264,20 @@ | |||
332 | 1284 | moves upwards the ancestor path until the first instance (if any) of the var | 1264 | moves upwards the ancestor path until the first instance (if any) of the var |
333 | 1285 | is found. | 1265 | is found. |
334 | 1286 | 1266 | ||
337 | 1287 | If var is not found, the method raises the given error, unless the given error | 1267 | If var is not found, the method raises XPST0008, unless the raiseError param |
338 | 1288 | is MAX_ZORBA_ERROR_CODE, in which case it returns NULL. | 1268 | is alse, in which case it returns NULL. |
339 | 1289 | ********************************************************************************/ | 1269 | ********************************************************************************/ |
341 | 1290 | var_expr* lookup_var(const store::Item* qname, const QueryLoc& loc, const Error& err) | 1270 | var_expr* lookup_var(const store::Item* qname, const QueryLoc& loc, bool raiseError) |
342 | 1291 | { | 1271 | { |
343 | 1292 | VarInfo* var = theSctx->lookup_var(qname); | 1272 | VarInfo* var = theSctx->lookup_var(qname); |
344 | 1293 | 1273 | ||
345 | 1294 | if (!var) | 1274 | if (!var) |
346 | 1295 | { | 1275 | { |
348 | 1296 | if (err != zerr::ZXQP0000_NO_ERROR) | 1276 | if (raiseError) |
349 | 1297 | { | 1277 | { |
350 | 1298 | zstring varName = static_context::var_name(qname); | 1278 | zstring varName = static_context::var_name(qname); |
354 | 1299 | throw XQUERY_EXCEPTION_VAR(err, | 1279 | RAISE_ERROR(err::XPST0008, loc, |
355 | 1300 | ERROR_PARAMS(varName, ZED(VariabledUndeclared)), | 1280 | ERROR_PARAMS(ZED(XPST0008_VariableName_2), varName)); |
353 | 1301 | ERROR_LOC(loc)); | ||
356 | 1302 | } | 1281 | } |
357 | 1303 | 1282 | ||
358 | 1304 | return NULL; | 1283 | return NULL; |
359 | @@ -1909,10 +1888,10 @@ | |||
360 | 1909 | { | 1888 | { |
361 | 1910 | VarInDecl* varDecl = varDecls[j]; | 1889 | VarInDecl* varDecl = varDecls[j]; |
362 | 1911 | 1890 | ||
364 | 1912 | vars.insert(lookup_var(varDecl->get_var_name(), loc, err::XPST0008)); | 1891 | vars.insert(lookup_var(varDecl->get_var_name(), loc, true)); |
365 | 1913 | 1892 | ||
366 | 1914 | if (varDecl->get_posvar() != NULL) | 1893 | if (varDecl->get_posvar() != NULL) |
368 | 1915 | vars.insert(lookup_var(varDecl->get_posvar()->get_name(), loc, err::XPST0008)); | 1894 | vars.insert(lookup_var(varDecl->get_posvar()->get_name(), loc, true)); |
369 | 1916 | } | 1895 | } |
370 | 1917 | } | 1896 | } |
371 | 1918 | else if (typeid(c) == typeid(LetClause)) | 1897 | else if (typeid(c) == typeid(LetClause)) |
372 | @@ -1922,13 +1901,13 @@ | |||
373 | 1922 | 1901 | ||
374 | 1923 | for (int j = (int)lV.size() - 1; j >= 0; --j) | 1902 | for (int j = (int)lV.size() - 1; j >= 0; --j) |
375 | 1924 | { | 1903 | { |
377 | 1925 | vars.insert(lookup_var(lV[j]->get_var_name(), loc, err::XPST0008)); | 1904 | vars.insert(lookup_var(lV[j]->get_var_name(), loc, true)); |
378 | 1926 | } | 1905 | } |
379 | 1927 | } | 1906 | } |
380 | 1928 | else if (typeid(c) == typeid(WindowClause)) | 1907 | else if (typeid(c) == typeid(WindowClause)) |
381 | 1929 | { | 1908 | { |
382 | 1930 | const WindowClause& wc = *static_cast<const WindowClause *>(&c); | 1909 | const WindowClause& wc = *static_cast<const WindowClause *>(&c); |
384 | 1931 | vars.insert(lookup_var(wc.get_var()->get_var_name(), loc, err::XPST0008)); | 1910 | vars.insert(lookup_var(wc.get_var()->get_var_name(), loc, true)); |
385 | 1932 | for (int j = 1; j >= 0; j--) | 1911 | for (int j = 1; j >= 0; j--) |
386 | 1933 | { | 1912 | { |
387 | 1934 | const FLWORWinCond* cond = &*wc[j]; | 1913 | const FLWORWinCond* cond = &*wc[j]; |
388 | @@ -1938,13 +1917,13 @@ | |||
389 | 1938 | if (wv != NULL) | 1917 | if (wv != NULL) |
390 | 1939 | { | 1918 | { |
391 | 1940 | if (wv->get_next()) | 1919 | if (wv->get_next()) |
393 | 1941 | vars.insert(lookup_var(wv->get_next(), loc, err::XPST0008)); | 1920 | vars.insert(lookup_var(wv->get_next(), loc, true)); |
394 | 1942 | if (wv->get_prev()) | 1921 | if (wv->get_prev()) |
396 | 1943 | vars.insert(lookup_var(wv->get_prev(), loc, err::XPST0008)); | 1922 | vars.insert(lookup_var(wv->get_prev(), loc, true)); |
397 | 1944 | if (wv->get_curr()) | 1923 | if (wv->get_curr()) |
399 | 1945 | vars.insert(lookup_var(wv->get_curr(), loc, err::XPST0008)); | 1924 | vars.insert(lookup_var(wv->get_curr(), loc, true)); |
400 | 1946 | if (wv->get_posvar() != NULL) | 1925 | if (wv->get_posvar() != NULL) |
402 | 1947 | vars.insert(lookup_var(wv->get_posvar()->get_name(), loc, err::XPST0008)); | 1926 | vars.insert(lookup_var(wv->get_posvar()->get_name(), loc, true)); |
403 | 1948 | } | 1927 | } |
404 | 1949 | } | 1928 | } |
405 | 1950 | } | 1929 | } |
406 | @@ -1953,7 +1932,7 @@ | |||
407 | 1953 | { | 1932 | { |
408 | 1954 | vars.insert(lookup_var(static_cast<const CountClause*>(&c)->get_varname(), | 1933 | vars.insert(lookup_var(static_cast<const CountClause*>(&c)->get_varname(), |
409 | 1955 | loc, | 1934 | loc, |
411 | 1956 | err::XPST0008)); | 1935 | true)); |
412 | 1957 | } | 1936 | } |
413 | 1958 | else if (typeid(c) == typeid(OrderByClause)) | 1937 | else if (typeid(c) == typeid(OrderByClause)) |
414 | 1959 | { | 1938 | { |
415 | @@ -1968,7 +1947,7 @@ | |||
416 | 1968 | { | 1947 | { |
417 | 1969 | GroupSpec* groupSpec = (*(groupClause.get_spec_list()))[gSpecPos]; | 1948 | GroupSpec* groupSpec = (*(groupClause.get_spec_list()))[gSpecPos]; |
418 | 1970 | if (groupSpec->get_binding_expr() != NULL) | 1949 | if (groupSpec->get_binding_expr() != NULL) |
420 | 1971 | vars.insert(lookup_var(groupSpec->get_var_name(), loc, err::XPST0008)); | 1950 | vars.insert(lookup_var(groupSpec->get_var_name(), loc, true)); |
421 | 1972 | } | 1951 | } |
422 | 1973 | 1952 | ||
423 | 1974 | // Group-by redefines ALL previous variables, but the GroupByClause lists | 1953 | // Group-by redefines ALL previous variables, but the GroupByClause lists |
424 | @@ -2169,7 +2148,7 @@ | |||
425 | 2169 | theSctx->set_default_elem_type_ns(targetNS, true, loc); | 2148 | theSctx->set_default_elem_type_ns(targetNS, true, loc); |
426 | 2170 | 2149 | ||
427 | 2171 | if (! pfx.empty()) | 2150 | if (! pfx.empty()) |
429 | 2172 | theSctx->bind_ns(pfx, targetNS, loc, err::XQST0033); | 2151 | theSctx->bind_ns(pfx, targetNS, loc); |
430 | 2173 | } | 2152 | } |
431 | 2174 | 2153 | ||
432 | 2175 | zstring xsdTNS = zstring(XML_SCHEMA_NS); | 2154 | zstring xsdTNS = zstring(XML_SCHEMA_NS); |
433 | @@ -3005,7 +2984,7 @@ | |||
434 | 3005 | ! (pfx == theModulePrefix && | 2984 | ! (pfx == theModulePrefix && |
435 | 3006 | targetNS == theModuleNamespace)) | 2985 | targetNS == theModuleNamespace)) |
436 | 3007 | { | 2986 | { |
438 | 3008 | theSctx->bind_ns(pfx, targetNS, loc, err::XQST0033); | 2987 | theSctx->bind_ns(pfx, targetNS, loc); |
439 | 3009 | } | 2988 | } |
440 | 3010 | 2989 | ||
441 | 3011 | const URILiteralList* atlist = v.get_at_list(); | 2990 | const URILiteralList* atlist = v.get_at_list(); |
442 | @@ -3988,7 +3967,7 @@ | |||
443 | 3988 | 3967 | ||
444 | 3989 | if (theSctx->xquery_version() >= StaticContextConsts::xquery_version_3_0) | 3968 | if (theSctx->xquery_version() >= StaticContextConsts::xquery_version_3_0) |
445 | 3990 | { | 3969 | { |
447 | 3991 | ve = lookup_var(qnameItem, loc, err::XPST0008); | 3970 | ve = lookup_var(qnameItem, loc, true); |
448 | 3992 | 3971 | ||
449 | 3993 | assert(ve); | 3972 | assert(ve); |
450 | 3994 | } | 3973 | } |
451 | @@ -5003,16 +4982,10 @@ | |||
452 | 5003 | flwor_expr* evFlworExpr = theExprManager-> | 4982 | flwor_expr* evFlworExpr = theExprManager-> |
453 | 5004 | create_flwor_expr(theRootSctx, theUDF, loc, false); | 4983 | create_flwor_expr(theRootSctx, theUDF, loc, false); |
454 | 5005 | 4984 | ||
459 | 5006 | evFlworExpr->set_return_expr(theExprManager->create_const_expr(theRootSctx, | 4985 | evFlworExpr->set_return_expr(CREATE(const)(theRootSctx, theUDF, loc, true)); |
456 | 5007 | theUDF, | ||
457 | 5008 | loc, | ||
458 | 5009 | true)); | ||
460 | 5010 | 4986 | ||
461 | 5011 | // $x_ in dc:collection( xs:QName("org:employees") ) | 4987 | // $x_ in dc:collection( xs:QName("org:employees") ) |
466 | 5012 | var_expr* evVarExpr = bind_var(loc, | 4988 | var_expr* evVarExpr = bind_var(loc, varItem, var_expr::for_var, NULL); |
463 | 5013 | varItem, | ||
464 | 5014 | var_expr::for_var, | ||
465 | 5015 | NULL); | ||
467 | 5016 | 4989 | ||
468 | 5017 | // maybe make one more collExpr? | 4990 | // maybe make one more collExpr? |
469 | 5018 | evFlworExpr->add_clause(wrap_in_forclause(collExpr, evVarExpr, NULL)); | 4991 | evFlworExpr->add_clause(wrap_in_forclause(collExpr, evVarExpr, NULL)); |
470 | @@ -5941,7 +5914,7 @@ | |||
471 | 5941 | { | 5914 | { |
472 | 5942 | TRACE_VISIT_OUT(); | 5915 | TRACE_VISIT_OUT(); |
473 | 5943 | 5916 | ||
475 | 5944 | var_expr* ve = lookup_var(v.get_name(), loc, err::XPST0008); | 5917 | var_expr* ve = lookup_var(v.get_name(), loc, true); |
476 | 5945 | 5918 | ||
477 | 5946 | if ((ve->get_kind() != var_expr::local_var && | 5919 | if ((ve->get_kind() != var_expr::local_var && |
478 | 5947 | ve->get_kind() != var_expr::prolog_var) || | 5920 | ve->get_kind() != var_expr::prolog_var) || |
479 | @@ -6862,11 +6835,11 @@ | |||
480 | 6862 | 6835 | ||
481 | 6863 | if (spec->get_binding_expr() == NULL) | 6836 | if (spec->get_binding_expr() == NULL) |
482 | 6864 | { | 6837 | { |
484 | 6865 | ve = lookup_var(varname, loc, err::XPST0008); | 6838 | ve = lookup_var(varname, loc, true); |
485 | 6866 | } | 6839 | } |
486 | 6867 | else | 6840 | else |
487 | 6868 | { | 6841 | { |
489 | 6869 | ve = lookup_var(varname, loc, zerr::ZXQP0000_NO_ERROR); | 6842 | ve = lookup_var(varname, loc, false); |
490 | 6870 | } | 6843 | } |
491 | 6871 | 6844 | ||
492 | 6872 | if (ve != NULL) | 6845 | if (ve != NULL) |
493 | @@ -6947,16 +6920,14 @@ | |||
494 | 6947 | if (!var) | 6920 | if (!var) |
495 | 6948 | { | 6921 | { |
496 | 6949 | RAISE_ERROR(err::XPST0008, specLoc, | 6922 | RAISE_ERROR(err::XPST0008, specLoc, |
498 | 6950 | ERROR_PARAMS(varName->getStringValue(), ZED(VariabledUndeclared))); | 6923 | ERROR_PARAMS(ZED(XPST0008_VariableName_2), varName->getStringValue())); |
499 | 6951 | } | 6924 | } |
500 | 6952 | 6925 | ||
501 | 6953 | expr* inputExpr = var->getVar(); | 6926 | expr* inputExpr = var->getVar(); |
502 | 6954 | 6927 | ||
508 | 6955 | if (inputExpr->get_expr_kind() == var_expr_kind) | 6928 | assert(inputExpr->get_expr_kind() == var_expr_kind); |
509 | 6956 | { | 6929 | |
510 | 6957 | inputExpr = theExprManager-> | 6930 | inputExpr = CREATE(wrapper)(theRootSctx, theUDF, specLoc, inputExpr); |
506 | 6958 | create_wrapper_expr(theRootSctx, theUDF, specLoc, inputExpr); | ||
507 | 6959 | } | ||
511 | 6960 | 6931 | ||
512 | 6961 | inputExpr = wrap_in_atomization(inputExpr); | 6932 | inputExpr = wrap_in_atomization(inputExpr); |
513 | 6962 | 6933 | ||
514 | @@ -8633,7 +8604,8 @@ | |||
515 | 8633 | if (e.diagnostic() == err::FORG0001) | 8604 | if (e.diagnostic() == err::FORG0001) |
516 | 8634 | throw;// XQUERY_EXCEPTION(err::XPST0003, ERROR_LOC(loc)); | 8605 | throw;// XQUERY_EXCEPTION(err::XPST0003, ERROR_LOC(loc)); |
517 | 8635 | else | 8606 | else |
519 | 8636 | RAISE_ERROR(err::XPST0081, loc, ERROR_PARAMS(result->getStringValue())); | 8607 | RAISE_ERROR(err::XPST0081, loc, |
520 | 8608 | ERROR_PARAMS(ce->get_val()->getStringValue())); | ||
521 | 8637 | } | 8609 | } |
522 | 8638 | } | 8610 | } |
523 | 8639 | 8611 | ||
524 | @@ -9345,7 +9317,7 @@ | |||
525 | 9345 | 9317 | ||
526 | 9346 | if (stepExpr->get_expr_kind() == wrapper_expr_kind) | 9318 | if (stepExpr->get_expr_kind() == wrapper_expr_kind) |
527 | 9347 | { | 9319 | { |
529 | 9348 | var_expr* dotVar = lookup_var(DOT_VARNAME, loc, zerr::ZXQP0000_NO_ERROR); | 9320 | var_expr* dotVar = lookup_var(DOT_VARNAME, loc, false); |
530 | 9349 | if (static_cast<wrapper_expr*>(stepExpr)->get_input() == dotVar) | 9321 | if (static_cast<wrapper_expr*>(stepExpr)->get_input() == dotVar) |
531 | 9350 | errKind = TREAT_PATH_DOT; | 9322 | errKind = TREAT_PATH_DOT; |
532 | 9351 | } | 9323 | } |
533 | @@ -10371,7 +10343,7 @@ | |||
534 | 10371 | 10343 | ||
535 | 10372 | try | 10344 | try |
536 | 10373 | { | 10345 | { |
538 | 10374 | ve = lookup_var(v.get_name(), loc, err::XPST0008); | 10346 | ve = lookup_var(v.get_name(), loc, true); |
539 | 10375 | } | 10347 | } |
540 | 10376 | catch (const ZorbaException& e) | 10348 | catch (const ZorbaException& e) |
541 | 10377 | { | 10349 | { |
542 | @@ -10404,33 +10376,48 @@ | |||
543 | 10404 | 10376 | ||
544 | 10405 | xqtref_t declaredType = ve->get_type(); | 10377 | xqtref_t declaredType = ve->get_type(); |
545 | 10406 | 10378 | ||
547 | 10407 | if (declaredType != NULL && !TypeOps::is_in_scope(tm, *declaredType)) | 10379 | if (declaredType != NULL && !TypeOps::is_in_scope(tm, *declaredType) && |
548 | 10380 | theSctx->xquery_version() == StaticContextConsts::xquery_version_1_0) | ||
549 | 10408 | { | 10381 | { |
554 | 10409 | const Error& error = (declaredType->get_manager() == tm ? | 10382 | if (declaredType->get_manager() == tm) |
551 | 10410 | err::XPTY0004 : err::XQST0036); | ||
552 | 10411 | |||
553 | 10412 | if (theModuleNamespace.empty()) | ||
555 | 10413 | { | 10383 | { |
564 | 10414 | throw XQUERY_EXCEPTION_VAR( | 10384 | if (theModuleNamespace.empty()) |
565 | 10415 | error, | 10385 | { |
566 | 10416 | ERROR_PARAMS(ZED(BadType_23o), | 10386 | RAISE_ERROR(err::XPTY0004, loc, |
567 | 10417 | *declaredType, | 10387 | ERROR_PARAMS(ZED(BadType_23o), |
568 | 10418 | ZED( NoTypeInMainModule_4 ), | 10388 | *declaredType, |
569 | 10419 | ve->get_name()->getStringValue()), | 10389 | ZED(NoTypeInMainModule_4), |
570 | 10420 | ERROR_LOC( loc ) | 10390 | ve->get_name()->getStringValue())); |
571 | 10421 | ); | 10391 | } |
572 | 10392 | else | ||
573 | 10393 | { | ||
574 | 10394 | RAISE_ERROR(err::XPTY0004, loc, | ||
575 | 10395 | ERROR_PARAMS(ZED(BadType_23o), | ||
576 | 10396 | *declaredType, | ||
577 | 10397 | ZED(NoTypeInModule_45), | ||
578 | 10398 | ve->get_name()->getStringValue(), | ||
579 | 10399 | theModuleNamespace)); | ||
580 | 10400 | } | ||
581 | 10422 | } | 10401 | } |
582 | 10423 | else | 10402 | else |
583 | 10424 | { | 10403 | { |
589 | 10425 | throw XQUERY_EXCEPTION_VAR( | 10404 | if (theModuleNamespace.empty()) |
590 | 10426 | error, | 10405 | { |
591 | 10427 | ERROR_PARAMS(ZED(BadType_23o), | 10406 | RAISE_ERROR(err::XQST0036, loc, |
592 | 10428 | *declaredType, | 10407 | ERROR_PARAMS(ZED(BadType_23o), |
593 | 10429 | ZED( NoTypeInModule_45 ), | 10408 | *declaredType, |
594 | 10409 | ZED(NoTypeInMainModule_4), | ||
595 | 10410 | ve->get_name()->getStringValue())); | ||
596 | 10411 | } | ||
597 | 10412 | else | ||
598 | 10413 | { | ||
599 | 10414 | RAISE_ERROR(err::XQST0036, loc, | ||
600 | 10415 | ERROR_PARAMS(ZED(BadType_23o), | ||
601 | 10416 | *declaredType, | ||
602 | 10417 | ZED(NoTypeInModule_45), | ||
603 | 10430 | ve->get_name()->getStringValue(), | 10418 | ve->get_name()->getStringValue(), |
607 | 10431 | theModuleNamespace), | 10419 | theModuleNamespace)); |
608 | 10432 | ERROR_LOC( loc ) | 10420 | } |
606 | 10433 | ); | ||
609 | 10434 | } | 10421 | } |
610 | 10435 | } | 10422 | } |
611 | 10436 | 10423 | ||
612 | @@ -10578,7 +10565,8 @@ | |||
613 | 10578 | 10565 | ||
614 | 10579 | xqtref_t retType = sign.returnType(); | 10566 | xqtref_t retType = sign.returnType(); |
615 | 10580 | 10567 | ||
617 | 10581 | if (!TypeOps::is_in_scope(tm, *retType)) | 10568 | if (!TypeOps::is_in_scope(tm, *retType) && |
618 | 10569 | theSctx->xquery_version() == StaticContextConsts::xquery_version_1_0) | ||
619 | 10582 | { | 10570 | { |
620 | 10583 | if (theModuleNamespace.empty()) | 10571 | if (theModuleNamespace.empty()) |
621 | 10584 | { | 10572 | { |
622 | @@ -10604,7 +10592,9 @@ | |||
623 | 10604 | for (csize i = 0; i < numParams; ++i) | 10592 | for (csize i = 0; i < numParams; ++i) |
624 | 10605 | { | 10593 | { |
625 | 10606 | xqtref_t type = sign[i]; | 10594 | xqtref_t type = sign[i]; |
627 | 10607 | if (!TypeOps::is_in_scope(tm, *type)) | 10595 | |
628 | 10596 | if (!TypeOps::is_in_scope(tm, *type) && | ||
629 | 10597 | theSctx->xquery_version() == StaticContextConsts::xquery_version_1_0) | ||
630 | 10608 | { | 10598 | { |
631 | 10609 | if (theModuleNamespace.empty()) | 10599 | if (theModuleNamespace.empty()) |
632 | 10610 | { | 10600 | { |
633 | @@ -11186,7 +11176,7 @@ | |||
634 | 11186 | ztd::to_string(theTempVarCounter++); | 11176 | ztd::to_string(theTempVarCounter++); |
635 | 11187 | GENV_ITEMFACTORY->createQName(qnameItem, "", "", localName.c_str()); | 11177 | GENV_ITEMFACTORY->createQName(qnameItem, "", "", localName.c_str()); |
636 | 11188 | } | 11178 | } |
638 | 11189 | while (lookup_var(qnameItem, loc, zerr::ZXQP0000_NO_ERROR) != NULL); | 11179 | while (lookup_var(qnameItem, loc, false) != NULL); |
639 | 11190 | 11180 | ||
640 | 11191 | var_expr* var = create_var(loc, qnameItem, var_expr::let_var); | 11181 | var_expr* var = create_var(loc, qnameItem, var_expr::let_var); |
641 | 11192 | temp_vars.push_back(var); | 11182 | temp_vars.push_back(var); |
642 | @@ -11976,7 +11966,7 @@ | |||
643 | 11976 | 11966 | ||
644 | 11977 | 11967 | ||
645 | 11978 | /******************************************************************************* | 11968 | /******************************************************************************* |
647 | 11979 | [120] DirAttributeList ::= DirAttr | DirAttributeList DirAttr | 11969 | [120] DirAttributeList ::= DirAttr | DirAttributeList DirAttr |
648 | 11980 | ********************************************************************************/ | 11970 | ********************************************************************************/ |
649 | 11981 | void* begin_visit(const DirAttributeList& v) | 11971 | void* begin_visit(const DirAttributeList& v) |
650 | 11982 | { | 11972 | { |
651 | @@ -11998,7 +11988,7 @@ | |||
652 | 11998 | } | 11988 | } |
653 | 11999 | } | 11989 | } |
654 | 12000 | 11990 | ||
656 | 12001 | unsigned long numAttrs = 0; | 11991 | csize numAttrs = 0; |
657 | 12002 | std::vector<attr_expr*> attributes; | 11992 | std::vector<attr_expr*> attributes; |
658 | 12003 | while(true) | 11993 | while(true) |
659 | 12004 | { | 11994 | { |
660 | @@ -12009,7 +11999,7 @@ | |||
661 | 12009 | attr_expr* attrExpr = dynamic_cast<attr_expr*>(expr); | 11999 | attr_expr* attrExpr = dynamic_cast<attr_expr*>(expr); |
662 | 12010 | const store::Item* attExprName = attrExpr->getQName(); | 12000 | const store::Item* attExprName = attrExpr->getQName(); |
663 | 12011 | 12001 | ||
665 | 12012 | for (unsigned long i = 0; i < numAttrs; ++i) | 12002 | for (csize i = 0; i < numAttrs; ++i) |
666 | 12013 | { | 12003 | { |
667 | 12014 | const store::Item* attName = attributes[i]->getQName(); | 12004 | const store::Item* attName = attributes[i]->getQName(); |
668 | 12015 | if (attName->equals(attExprName)) | 12005 | if (attName->equals(attExprName)) |
669 | @@ -12034,8 +12024,8 @@ | |||
670 | 12034 | args.push_back((*it)); | 12024 | args.push_back((*it)); |
671 | 12035 | } | 12025 | } |
672 | 12036 | 12026 | ||
675 | 12037 | fo_expr* expr_list = | 12027 | fo_expr* expr_list = |
676 | 12038 | theExprManager->create_fo_expr(theRootSctx, theUDF, loc, op_concatenate, args); | 12028 | CREATE(fo)(theRootSctx, theUDF, loc, op_concatenate, args); |
677 | 12039 | 12029 | ||
678 | 12040 | normalize_fo(expr_list); | 12030 | normalize_fo(expr_list); |
679 | 12041 | 12031 | ||
680 | @@ -12045,6 +12035,7 @@ | |||
681 | 12045 | return NULL; // reject visitor -- everything done | 12035 | return NULL; // reject visitor -- everything done |
682 | 12046 | } | 12036 | } |
683 | 12047 | 12037 | ||
684 | 12038 | |||
685 | 12048 | void end_visit(const DirAttributeList& v, void* /*visit_state*/) | 12039 | void end_visit(const DirAttributeList& v, void* /*visit_state*/) |
686 | 12049 | { | 12040 | { |
687 | 12050 | // begin_visit() rejects visitor | 12041 | // begin_visit() rejects visitor |
688 | @@ -12089,15 +12080,13 @@ | |||
689 | 12089 | prefix = qname->get_localname(); | 12080 | prefix = qname->get_localname(); |
690 | 12090 | 12081 | ||
691 | 12091 | if (ZSTREQ(prefix, "xmlns")) | 12082 | if (ZSTREQ(prefix, "xmlns")) |
697 | 12092 | throw XQUERY_EXCEPTION( | 12083 | RAISE_ERROR(err::XQST0070, loc, |
698 | 12093 | err::XQST0070, | 12084 | ERROR_PARAMS(prefix, ZED(NoRebindPrefix))); |
694 | 12094 | ERROR_PARAMS( prefix, ZED( NoRebindPrefix ) ), | ||
695 | 12095 | ERROR_LOC( loc ) | ||
696 | 12096 | ); | ||
699 | 12097 | } | 12085 | } |
700 | 12098 | 12086 | ||
701 | 12099 | const_expr* constValueExpr = dynamic_cast<const_expr*>(valueExpr); | 12087 | const_expr* constValueExpr = dynamic_cast<const_expr*>(valueExpr); |
702 | 12100 | fo_expr* foExpr = dynamic_cast<fo_expr*>(valueExpr); | 12088 | fo_expr* foExpr = dynamic_cast<fo_expr*>(valueExpr); |
703 | 12089 | |||
704 | 12101 | if (foExpr != NULL && foExpr->get_func() != op_concatenate) | 12090 | if (foExpr != NULL && foExpr->get_func() != op_concatenate) |
705 | 12102 | foExpr = NULL; | 12091 | foExpr = NULL; |
706 | 12103 | 12092 | ||
707 | @@ -12108,7 +12097,7 @@ | |||
708 | 12108 | } | 12097 | } |
709 | 12109 | else if (foExpr != NULL) | 12098 | else if (foExpr != NULL) |
710 | 12110 | { | 12099 | { |
712 | 12111 | for (unsigned int i=0; i<foExpr->num_args(); i++) | 12100 | for (csize i = 0; i < foExpr->num_args(); ++i) |
713 | 12112 | { | 12101 | { |
714 | 12113 | const_expr* constValueExpr = dynamic_cast<const_expr*>(foExpr->get_arg(i)); | 12102 | const_expr* constValueExpr = dynamic_cast<const_expr*>(foExpr->get_arg(i)); |
715 | 12114 | if (constValueExpr != NULL) | 12103 | if (constValueExpr != NULL) |
716 | @@ -12143,7 +12132,7 @@ | |||
717 | 12143 | RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(uri, ZED(NoBindURI))); | 12132 | RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(uri, ZED(NoBindURI))); |
718 | 12144 | } | 12133 | } |
719 | 12145 | 12134 | ||
721 | 12146 | theSctx->bind_ns(prefix, uri, loc, err::XQST0071); | 12135 | theSctx->bind_ns(prefix, uri, loc); |
722 | 12147 | theNSCtx->bind_ns(prefix, uri); | 12136 | theNSCtx->bind_ns(prefix, uri); |
723 | 12148 | 12137 | ||
724 | 12149 | if (prefix.empty()) | 12138 | if (prefix.empty()) |
725 | @@ -12159,7 +12148,7 @@ | |||
726 | 12159 | 12148 | ||
727 | 12160 | // unbind the prefix | 12149 | // unbind the prefix |
728 | 12161 | zstring empty; | 12150 | zstring empty; |
730 | 12162 | theSctx->bind_ns(prefix, empty, loc, err::XQST0071); | 12151 | theSctx->bind_ns(prefix, empty, loc); |
731 | 12163 | theNSCtx->bind_ns(prefix, empty); | 12152 | theNSCtx->bind_ns(prefix, empty); |
732 | 12164 | 12153 | ||
733 | 12165 | if (prefix.empty()) | 12154 | if (prefix.empty()) |
734 | @@ -12170,13 +12159,13 @@ | |||
735 | 12170 | throw XQUERY_EXCEPTION(err::XQST0022, ERROR_LOC(loc)); | 12159 | throw XQUERY_EXCEPTION(err::XQST0022, ERROR_LOC(loc)); |
736 | 12171 | } | 12160 | } |
737 | 12172 | } | 12161 | } |
738 | 12173 | else | ||
739 | 12174 | // Plain direct attribute | 12162 | // Plain direct attribute |
740 | 12163 | else | ||
741 | 12175 | { | 12164 | { |
742 | 12176 | store::Item_t qnameItem; | 12165 | store::Item_t qnameItem; |
743 | 12177 | expand_no_default_qname(qnameItem, qname, qname->get_location()); | 12166 | expand_no_default_qname(qnameItem, qname, qname->get_location()); |
744 | 12178 | 12167 | ||
746 | 12179 | expr* nameExpr = theExprManager->create_const_expr(theRootSctx, theUDF, loc, qnameItem); | 12168 | expr* nameExpr = CREATE(const)(theRootSctx, theUDF, loc, qnameItem); |
747 | 12180 | 12169 | ||
748 | 12181 | fo_expr* foExpr = NULL; | 12170 | fo_expr* foExpr = NULL; |
749 | 12182 | if ((foExpr = dynamic_cast<fo_expr*>(valueExpr)) != NULL && | 12171 | if ((foExpr = dynamic_cast<fo_expr*>(valueExpr)) != NULL && |
750 | @@ -12904,7 +12893,8 @@ | |||
751 | 12904 | 12893 | ||
752 | 12905 | xqtref_t t = CTX_TM->create_named_atomic_type(qnameItem, | 12894 | xqtref_t t = CTX_TM->create_named_atomic_type(qnameItem, |
753 | 12906 | TypeConstants::QUANT_ONE, | 12895 | TypeConstants::QUANT_ONE, |
755 | 12907 | loc); | 12896 | loc, |
756 | 12897 | false); | ||
757 | 12908 | 12898 | ||
758 | 12909 | // some types that should never be parsed, like xs:untyped, are; | 12899 | // some types that should never be parsed, like xs:untyped, are; |
759 | 12910 | // we catch them with is_simple() | 12900 | // we catch them with is_simple() |
760 | @@ -13269,11 +13259,8 @@ | |||
761 | 13269 | 13259 | ||
762 | 13270 | if (contentType == NULL) | 13260 | if (contentType == NULL) |
763 | 13271 | { | 13261 | { |
769 | 13272 | throw XQUERY_EXCEPTION( | 13262 | RAISE_ERROR(err::XPST0008, loc, |
770 | 13273 | err::XPST0008, | 13263 | ERROR_PARAMS(typeNameItem->getStringValue(), ZED(AttributeName))); |
766 | 13274 | ERROR_PARAMS( typeNameItem->getStringValue(), ZED( AttributeName ) ), | ||
767 | 13275 | ERROR_LOC( loc ) | ||
768 | 13276 | ); | ||
771 | 13277 | } | 13264 | } |
772 | 13278 | } | 13265 | } |
773 | 13279 | 13266 | ||
774 | 13280 | 13267 | ||
775 | === modified file 'src/context/dynamic_context.cpp' | |||
776 | --- src/context/dynamic_context.cpp 2012-12-11 00:22:26 +0000 | |||
777 | +++ src/context/dynamic_context.cpp 2013-01-08 11:10:56 +0000 | |||
778 | @@ -462,7 +462,7 @@ | |||
779 | 462 | theVarValues[varid].theState == VarValue::undeclared) | 462 | theVarValues[varid].theState == VarValue::undeclared) |
780 | 463 | { | 463 | { |
781 | 464 | RAISE_ERROR(err::XPDY0002, loc, | 464 | RAISE_ERROR(err::XPDY0002, loc, |
783 | 465 | ERROR_PARAMS(varname->getStringValue(), ZED(VariabledUndeclared))); | 465 | ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), varname->getStringValue())); |
784 | 466 | } | 466 | } |
785 | 467 | 467 | ||
786 | 468 | valueIter->open(); | 468 | valueIter->open(); |
787 | @@ -516,7 +516,7 @@ | |||
788 | 516 | theVarValues[varid].theState == VarValue::undeclared) | 516 | theVarValues[varid].theState == VarValue::undeclared) |
789 | 517 | { | 517 | { |
790 | 518 | RAISE_ERROR(err::XPDY0002, loc, | 518 | RAISE_ERROR(err::XPDY0002, loc, |
792 | 519 | ERROR_PARAMS(varname->getStringValue(), ZED(VariabledUndeclared))); | 519 | ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), varname->getStringValue())); |
793 | 520 | } | 520 | } |
794 | 521 | 521 | ||
795 | 522 | VarValue& var = theVarValues[varid]; | 522 | VarValue& var = theVarValues[varid]; |
796 | @@ -559,7 +559,7 @@ | |||
797 | 559 | theVarValues[varid].theState == VarValue::undeclared) | 559 | theVarValues[varid].theState == VarValue::undeclared) |
798 | 560 | { | 560 | { |
799 | 561 | RAISE_ERROR(err::XPDY0002, loc, | 561 | RAISE_ERROR(err::XPDY0002, loc, |
801 | 562 | ERROR_PARAMS(varname->getStringValue(), ZED(VariabledUndeclared))); | 562 | ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), varname->getStringValue())); |
802 | 563 | } | 563 | } |
803 | 564 | 564 | ||
804 | 565 | VarValue& var = theVarValues[varid]; | 565 | VarValue& var = theVarValues[varid]; |
805 | @@ -606,14 +606,14 @@ | |||
806 | 606 | { | 606 | { |
807 | 607 | zstring varName = static_context::var_name(varname.getp()); | 607 | zstring varName = static_context::var_name(varname.getp()); |
808 | 608 | RAISE_ERROR(err::XPDY0002, loc, | 608 | RAISE_ERROR(err::XPDY0002, loc, |
810 | 609 | ERROR_PARAMS(varName, ZED(VariabledUndeclared))); | 609 | ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), varName)); |
811 | 610 | } | 610 | } |
812 | 611 | 611 | ||
813 | 612 | if (theVarValues[varid].theState == VarValue::declared) | 612 | if (theVarValues[varid].theState == VarValue::declared) |
814 | 613 | { | 613 | { |
815 | 614 | zstring varName = static_context::var_name(varname.getp()); | 614 | zstring varName = static_context::var_name(varname.getp()); |
816 | 615 | RAISE_ERROR(err::XPDY0002, loc, | 615 | RAISE_ERROR(err::XPDY0002, loc, |
818 | 616 | ERROR_PARAMS(varName, ZED(VariabledHasNoValue))); | 616 | ERROR_PARAMS(ZED(XPDY0002_VariableHasNoValue_2), varName)); |
819 | 617 | } | 617 | } |
820 | 618 | 618 | ||
821 | 619 | const VarValue& var = theVarValues[varid]; | 619 | const VarValue& var = theVarValues[varid]; |
822 | 620 | 620 | ||
823 | === modified file 'src/context/namespace_context.cpp' | |||
824 | --- src/context/namespace_context.cpp 2012-12-28 10:24:59 +0000 | |||
825 | +++ src/context/namespace_context.cpp 2013-01-08 11:10:56 +0000 | |||
826 | @@ -101,7 +101,7 @@ | |||
827 | 101 | else | 101 | else |
828 | 102 | { | 102 | { |
829 | 103 | QueryLoc loc; | 103 | QueryLoc loc; |
831 | 104 | bool found = m_sctx->lookup_ns(aNamespace, aPrefix, loc, zerr::ZXQP0000_NO_ERROR); | 104 | bool found = m_sctx->lookup_ns(aNamespace, aPrefix, loc, false); |
832 | 105 | 105 | ||
833 | 106 | if (!found && aPrefix.empty()) | 106 | if (!found && aPrefix.empty()) |
834 | 107 | { | 107 | { |
835 | 108 | 108 | ||
836 | === modified file 'src/context/root_static_context.cpp' | |||
837 | --- src/context/root_static_context.cpp 2012-12-12 19:34:45 +0000 | |||
838 | +++ src/context/root_static_context.cpp 2013-01-08 11:10:56 +0000 | |||
839 | @@ -33,7 +33,7 @@ | |||
840 | 33 | 33 | ||
841 | 34 | #ifdef WIN32 | 34 | #ifdef WIN32 |
842 | 35 | #include <zorba/config.h> | 35 | #include <zorba/config.h> |
844 | 36 | #endif WIN32 | 36 | #endif //WIN32 |
845 | 37 | 37 | ||
846 | 38 | 38 | ||
847 | 39 | // DEFINE ENVIRONMENT VARIABLES | 39 | // DEFINE ENVIRONMENT VARIABLES |
848 | 40 | 40 | ||
849 | === modified file 'src/context/static_context.cpp' | |||
850 | --- src/context/static_context.cpp 2012-12-11 20:27:40 +0000 | |||
851 | +++ src/context/static_context.cpp 2013-01-08 11:10:56 +0000 | |||
852 | @@ -2045,8 +2045,7 @@ | |||
853 | 2045 | void static_context::bind_ns( | 2045 | void static_context::bind_ns( |
854 | 2046 | const zstring& prefix, | 2046 | const zstring& prefix, |
855 | 2047 | const zstring& ns, | 2047 | const zstring& ns, |
858 | 2048 | const QueryLoc& loc, | 2048 | const QueryLoc& loc) |
857 | 2049 | const Error& err) | ||
859 | 2050 | { | 2049 | { |
860 | 2051 | if (theNamespaceBindings == NULL) | 2050 | if (theNamespaceBindings == NULL) |
861 | 2052 | { | 2051 | { |
862 | @@ -2057,9 +2056,7 @@ | |||
863 | 2057 | 2056 | ||
864 | 2058 | if (!theNamespaceBindings->insert(prefix, temp)) | 2057 | if (!theNamespaceBindings->insert(prefix, temp)) |
865 | 2059 | { | 2058 | { |
869 | 2060 | throw XQUERY_EXCEPTION_VAR(err, | 2059 | RAISE_ERROR(err::XQST0033, loc, ERROR_PARAMS(prefix, ns)); |
867 | 2061 | ERROR_PARAMS(prefix, temp), | ||
868 | 2062 | ERROR_LOC(loc)); | ||
870 | 2063 | } | 2060 | } |
871 | 2064 | } | 2061 | } |
872 | 2065 | 2062 | ||
873 | @@ -2075,19 +2072,17 @@ | |||
874 | 2075 | zstring& ns, | 2072 | zstring& ns, |
875 | 2076 | const zstring& prefix, | 2073 | const zstring& prefix, |
876 | 2077 | const QueryLoc& loc, | 2074 | const QueryLoc& loc, |
878 | 2078 | const Error& err) const | 2075 | bool raiseError) const |
879 | 2079 | { | 2076 | { |
880 | 2080 | if (theNamespaceBindings == NULL || !theNamespaceBindings->get(prefix, ns)) | 2077 | if (theNamespaceBindings == NULL || !theNamespaceBindings->get(prefix, ns)) |
881 | 2081 | { | 2078 | { |
882 | 2082 | if (theParent != NULL) | 2079 | if (theParent != NULL) |
883 | 2083 | { | 2080 | { |
885 | 2084 | return theParent->lookup_ns(ns, prefix, loc, err); | 2081 | return theParent->lookup_ns(ns, prefix, loc, raiseError); |
886 | 2085 | } | 2082 | } |
888 | 2086 | else if (err != zerr::ZXQP0000_NO_ERROR) | 2083 | else if (raiseError) |
889 | 2087 | { | 2084 | { |
893 | 2088 | throw XQUERY_EXCEPTION_VAR( | 2085 | RAISE_ERROR(err::XPST0081, loc, ERROR_PARAMS(prefix)); |
891 | 2089 | err, ERROR_PARAMS( prefix ), ERROR_LOC( loc ) | ||
892 | 2090 | ); | ||
894 | 2091 | } | 2086 | } |
895 | 2092 | else | 2087 | else |
896 | 2093 | { | 2088 | { |
897 | @@ -2096,11 +2091,9 @@ | |||
898 | 2096 | } | 2091 | } |
899 | 2097 | else if (!prefix.empty() && ns.empty()) | 2092 | else if (!prefix.empty() && ns.empty()) |
900 | 2098 | { | 2093 | { |
902 | 2099 | if (err != zerr::ZXQP0000_NO_ERROR) | 2094 | if (raiseError) |
903 | 2100 | { | 2095 | { |
907 | 2101 | throw XQUERY_EXCEPTION_VAR( | 2096 | RAISE_ERROR(err::XPST0081, loc, ERROR_PARAMS(prefix)); |
905 | 2102 | err, ERROR_PARAMS( prefix ), ERROR_LOC( loc ) | ||
906 | 2103 | ); | ||
908 | 2104 | } | 2097 | } |
909 | 2105 | else | 2098 | else |
910 | 2106 | { | 2099 | { |
911 | @@ -2188,10 +2181,7 @@ | |||
912 | 2188 | /***************************************************************************//** | 2181 | /***************************************************************************//** |
913 | 2189 | 2182 | ||
914 | 2190 | ********************************************************************************/ | 2183 | ********************************************************************************/ |
919 | 2191 | void static_context::bind_var( | 2184 | void static_context::bind_var(var_expr* varExpr, const QueryLoc& loc) |
916 | 2192 | var_expr* varExpr, | ||
917 | 2193 | const QueryLoc& loc, | ||
918 | 2194 | const Error& err) | ||
920 | 2195 | { | 2185 | { |
921 | 2196 | if (theVariablesMap == NULL) | 2186 | if (theVariablesMap == NULL) |
922 | 2197 | { | 2187 | { |
923 | @@ -2208,8 +2198,7 @@ | |||
924 | 2208 | 2198 | ||
925 | 2209 | if (!theVariablesMap->insert(qname, vi)) | 2199 | if (!theVariablesMap->insert(qname, vi)) |
926 | 2210 | { | 2200 | { |
929 | 2211 | throw XQUERY_EXCEPTION_VAR(err, | 2201 | goto error; |
928 | 2212 | ERROR_PARAMS(qname->getStringValue()), ERROR_LOC(loc)); | ||
930 | 2213 | } | 2202 | } |
931 | 2214 | 2203 | ||
932 | 2215 | if (varExpr->get_kind() == var_expr::prolog_var) | 2204 | if (varExpr->get_kind() == var_expr::prolog_var) |
933 | @@ -2219,10 +2208,32 @@ | |||
934 | 2219 | { | 2208 | { |
935 | 2220 | if (!theVariablesMap->insert(qname, vi)) | 2209 | if (!theVariablesMap->insert(qname, vi)) |
936 | 2221 | { | 2210 | { |
939 | 2222 | throw XQUERY_EXCEPTION_VAR(err, | 2211 | goto error; |
938 | 2223 | ERROR_PARAMS(qname->getStringValue()), ERROR_LOC(loc)); | ||
940 | 2224 | } | 2212 | } |
941 | 2225 | } | 2213 | } |
942 | 2214 | |||
943 | 2215 | return; | ||
944 | 2216 | |||
945 | 2217 | error: | ||
946 | 2218 | switch (varExpr->get_kind()) | ||
947 | 2219 | { | ||
948 | 2220 | case var_expr::let_var: | ||
949 | 2221 | { | ||
950 | 2222 | RAISE_ERROR(err::XQST0039, loc, ERROR_PARAMS(qname->getStringValue())); | ||
951 | 2223 | } | ||
952 | 2224 | case var_expr::win_var: | ||
953 | 2225 | case var_expr::wincond_out_var: | ||
954 | 2226 | case var_expr::wincond_out_pos_var: | ||
955 | 2227 | case var_expr::wincond_in_var: | ||
956 | 2228 | case var_expr::wincond_in_pos_var: | ||
957 | 2229 | { | ||
958 | 2230 | RAISE_ERROR(err::XQST0103, loc, ERROR_PARAMS(qname->getStringValue())); | ||
959 | 2231 | } | ||
960 | 2232 | default: | ||
961 | 2233 | { | ||
962 | 2234 | RAISE_ERROR(err::XQST0049, loc, ERROR_PARAMS(qname->getStringValue())); | ||
963 | 2235 | } | ||
964 | 2236 | } | ||
965 | 2226 | } | 2237 | } |
966 | 2227 | 2238 | ||
967 | 2228 | 2239 | ||
968 | @@ -4085,7 +4096,7 @@ | |||
969 | 4085 | 4096 | ||
970 | 4086 | if (!ve->is_private()) | 4097 | if (!ve->is_private()) |
971 | 4087 | { | 4098 | { |
973 | 4088 | bind_var(ve, loc, err::XQST0049); | 4099 | bind_var(ve, loc); |
974 | 4089 | } | 4100 | } |
975 | 4090 | else | 4101 | else |
976 | 4091 | { | 4102 | { |
977 | 4092 | 4103 | ||
978 | === modified file 'src/context/static_context.h' | |||
979 | --- src/context/static_context.h 2012-12-06 01:17:18 +0000 | |||
980 | +++ src/context/static_context.h 2013-01-08 11:10:56 +0000 | |||
981 | @@ -853,14 +853,13 @@ | |||
982 | 853 | void bind_ns( | 853 | void bind_ns( |
983 | 854 | const zstring& prefix, | 854 | const zstring& prefix, |
984 | 855 | const zstring& ns, | 855 | const zstring& ns, |
987 | 856 | const QueryLoc& loc, | 856 | const QueryLoc& loc); |
986 | 857 | const Error& err = err::XQST0033); | ||
988 | 858 | 857 | ||
989 | 859 | bool lookup_ns( | 858 | bool lookup_ns( |
990 | 860 | zstring& ns, | 859 | zstring& ns, |
991 | 861 | const zstring& prefix, | 860 | const zstring& prefix, |
992 | 862 | const QueryLoc& loc, | 861 | const QueryLoc& loc, |
994 | 863 | const Error& err = err::XPST0081) const; | 862 | bool raiseError = true) const; |
995 | 864 | 863 | ||
996 | 865 | void expand_qname( | 864 | void expand_qname( |
997 | 866 | store::Item_t& qname, | 865 | store::Item_t& qname, |
998 | @@ -874,7 +873,7 @@ | |||
999 | 874 | // | 873 | // |
1000 | 875 | // Variables | 874 | // Variables |
1001 | 876 | // | 875 | // |
1003 | 877 | void bind_var(var_expr* expr, const QueryLoc& loc, const Error& err); | 876 | void bind_var(var_expr* expr, const QueryLoc& loc); |
1004 | 878 | 877 | ||
1005 | 879 | VarInfo* lookup_var(const store::Item* qname) const; | 878 | VarInfo* lookup_var(const store::Item* qname) const; |
1006 | 880 | 879 | ||
1007 | 881 | 880 | ||
1008 | === modified file 'src/diagnostics/diagnostic_en.xml' | |||
1009 | --- src/diagnostics/diagnostic_en.xml 2012-12-29 06:48:09 +0000 | |||
1010 | +++ src/diagnostics/diagnostic_en.xml 2013-01-08 11:10:56 +0000 | |||
1011 | @@ -136,7 +136,19 @@ | |||
1012 | 136 | that is not defined in the static context, except for an ElementName in | 136 | that is not defined in the static context, except for an ElementName in |
1013 | 137 | an ElementTest or an AttributeName in an AttributeTest. | 137 | an ElementTest or an AttributeName in an AttributeTest. |
1014 | 138 | </comment> | 138 | </comment> |
1016 | 139 | <value>"$1": undefined $2</value> | 139 | <value>$1</value> |
1017 | 140 | |||
1018 | 141 | <entry key="VariableName_2"> | ||
1019 | 142 | <value>"$2": undeclared variable</value> | ||
1020 | 143 | </entry> | ||
1021 | 144 | |||
1022 | 145 | <entry key="SchemaAttributeName_2"> | ||
1023 | 146 | <value>"$2": undefined schema-attribute name</value> | ||
1024 | 147 | </entry> | ||
1025 | 148 | |||
1026 | 149 | <entry key="SchemaElementName_2"> | ||
1027 | 150 | <value>"$2": undefined schema-element name</value> | ||
1028 | 151 | </entry> | ||
1029 | 140 | </diagnostic> | 152 | </diagnostic> |
1030 | 141 | 153 | ||
1031 | 142 | <diagnostic code="XPST0017"> | 154 | <diagnostic code="XPST0017"> |
1032 | @@ -714,7 +726,19 @@ | |||
1033 | 714 | It is a dynamic error if evaluation of an expression relies on some part | 726 | It is a dynamic error if evaluation of an expression relies on some part |
1034 | 715 | of the dynamic context that has not been assigned a value. | 727 | of the dynamic context that has not been assigned a value. |
1035 | 716 | </comment> | 728 | </comment> |
1037 | 717 | <value>"$1": $2</value> | 729 | <value>$1</value> |
1038 | 730 | |||
1039 | 731 | <entry key="VariableHasNoValue_2"> | ||
1040 | 732 | <value>"$2": variable has no value</value> | ||
1041 | 733 | </entry> | ||
1042 | 734 | |||
1043 | 735 | <entry key="VariableUndeclared_2"> | ||
1044 | 736 | <value>"$2": undeclared variable</value> | ||
1045 | 737 | </entry> | ||
1046 | 738 | |||
1047 | 739 | <entry key="ContextUndeclared_2"> | ||
1048 | 740 | <value>$2 not declared</value> | ||
1049 | 741 | </entry> | ||
1050 | 718 | </diagnostic> | 742 | </diagnostic> |
1051 | 719 | 743 | ||
1052 | 720 | <diagnostic code="XPDY0050"> | 744 | <diagnostic code="XPDY0050"> |
1053 | @@ -1522,7 +1546,7 @@ | |||
1054 | 1522 | affects an element node by introducing a new namespace binding that | 1546 | affects an element node by introducing a new namespace binding that |
1055 | 1523 | conflicts with one of its existing namespace bindings. | 1547 | conflicts with one of its existing namespace bindings. |
1056 | 1524 | </comment> | 1548 | </comment> |
1058 | 1525 | <value>"$1": namespace binding conflicts with $2=$3</value> | 1549 | <value>"$1": qname causes namespace binding conflict: prefix $2 cannot be bound to both $3 and $4</value> |
1059 | 1526 | </diagnostic> | 1550 | </diagnostic> |
1060 | 1527 | 1551 | ||
1061 | 1528 | <diagnostic code="XUDY0024"> | 1552 | <diagnostic code="XUDY0024"> |
1062 | @@ -1972,8 +1996,8 @@ | |||
1063 | 1972 | <value>XQuery not compiled in debug mode</value> | 1996 | <value>XQuery not compiled in debug mode</value> |
1064 | 1973 | </diagnostic> | 1997 | </diagnostic> |
1065 | 1974 | 1998 | ||
1068 | 1975 | <diagnostic code="ZAPI0011" name="ELEMENT_NOT_DECLARED"> | 1999 | <diagnostic code="ZAPI0011" name="VARIABLE_NOT_DECLARED"> |
1069 | 1976 | <value>"$1": undefined $2</value> | 2000 | <value>"$1": undeclared variable</value> |
1070 | 1977 | </diagnostic> | 2001 | </diagnostic> |
1071 | 1978 | 2002 | ||
1072 | 1979 | <diagnostic code="ZAPI0014" name="INVALID_ARGUMENT"> | 2003 | <diagnostic code="ZAPI0014" name="INVALID_ARGUMENT"> |
1073 | @@ -3545,14 +3569,6 @@ | |||
1074 | 3545 | <value>the standalone attribute has a value other than "omit"</value> | 3569 | <value>the standalone attribute has a value other than "omit"</value> |
1075 | 3546 | </entry> | 3570 | </entry> |
1076 | 3547 | 3571 | ||
1077 | 3548 | <entry key="SchemaAttributeName"> | ||
1078 | 3549 | <value>schema-attribute name</value> | ||
1079 | 3550 | </entry> | ||
1080 | 3551 | |||
1081 | 3552 | <entry key="SchemaElementName"> | ||
1082 | 3553 | <value>schema-element name</value> | ||
1083 | 3554 | </entry> | ||
1084 | 3555 | |||
1085 | 3556 | <entry key="SchemaOutOfMemory"> | 3572 | <entry key="SchemaOutOfMemory"> |
1086 | 3557 | <value>OutOfMemoryException during parsing</value> | 3573 | <value>OutOfMemoryException during parsing</value> |
1087 | 3558 | </entry> | 3574 | </entry> |
1088 | @@ -3802,18 +3818,6 @@ | |||
1089 | 3802 | <value>"$2": variable value must be single item</value> | 3818 | <value>"$2": variable value must be single item</value> |
1090 | 3803 | </entry> | 3819 | </entry> |
1091 | 3804 | 3820 | ||
1092 | 3805 | <entry key="Variable"> | ||
1093 | 3806 | <value>variable</value> | ||
1094 | 3807 | </entry> | ||
1095 | 3808 | |||
1096 | 3809 | <entry key="VariabledHasNoValue"> | ||
1097 | 3810 | <value>variable has no value</value> | ||
1098 | 3811 | </entry> | ||
1099 | 3812 | |||
1100 | 3813 | <entry key="VariabledUndeclared"> | ||
1101 | 3814 | <value>undeclared variable</value> | ||
1102 | 3815 | </entry> | ||
1103 | 3816 | |||
1104 | 3817 | <entry key="XMLSchema"> | 3821 | <entry key="XMLSchema"> |
1105 | 3818 | <value>XML schema</value> | 3822 | <value>XML schema</value> |
1106 | 3819 | </entry> | 3823 | </entry> |
1107 | 3820 | 3824 | ||
1108 | === modified file 'src/diagnostics/pregenerated/diagnostic_list.cpp' | |||
1109 | --- src/diagnostics/pregenerated/diagnostic_list.cpp 2012-12-21 22:05:39 +0000 | |||
1110 | +++ src/diagnostics/pregenerated/diagnostic_list.cpp 2013-01-08 11:10:56 +0000 | |||
1111 | @@ -717,7 +717,7 @@ | |||
1112 | 717 | ZorbaErrorCode ZAPI0009_XQUERY_NOT_COMPILED_IN_DEBUG_MODE( "ZAPI0009" ); | 717 | ZorbaErrorCode ZAPI0009_XQUERY_NOT_COMPILED_IN_DEBUG_MODE( "ZAPI0009" ); |
1113 | 718 | 718 | ||
1114 | 719 | 719 | ||
1116 | 720 | ZorbaErrorCode ZAPI0011_ELEMENT_NOT_DECLARED( "ZAPI0011" ); | 720 | ZorbaErrorCode ZAPI0011_VARIABLE_NOT_DECLARED( "ZAPI0011" ); |
1117 | 721 | 721 | ||
1118 | 722 | 722 | ||
1119 | 723 | ZorbaErrorCode ZAPI0014_INVALID_ARGUMENT( "ZAPI0014" ); | 723 | ZorbaErrorCode ZAPI0014_INVALID_ARGUMENT( "ZAPI0014" ); |
1120 | 724 | 724 | ||
1121 | === modified file 'src/diagnostics/pregenerated/dict_en.cpp' | |||
1122 | --- src/diagnostics/pregenerated/dict_en.cpp 2012-12-29 06:48:09 +0000 | |||
1123 | +++ src/diagnostics/pregenerated/dict_en.cpp 2013-01-08 11:10:56 +0000 | |||
1124 | @@ -178,12 +178,12 @@ | |||
1125 | 178 | { "SESU0007", "\"$1\": unsupported encoding" }, | 178 | { "SESU0007", "\"$1\": unsupported encoding" }, |
1126 | 179 | { "SESU0011", "\"$1\": unsupported normalization form" }, | 179 | { "SESU0011", "\"$1\": unsupported normalization form" }, |
1127 | 180 | { "SESU0013", "\"$1\": unsupported $2 version; supported versions are: $3" }, | 180 | { "SESU0013", "\"$1\": unsupported $2 version; supported versions are: $3" }, |
1129 | 181 | { "XPDY0002", "\"$1\": $2" }, | 181 | { "XPDY0002", "$1" }, |
1130 | 182 | { "XPDY0050", "\"$1\" cannot be treated as type $2" }, | 182 | { "XPDY0050", "\"$1\" cannot be treated as type $2" }, |
1131 | 183 | { "XPST0001", "${\"1\": }undefined value${: 2}" }, | 183 | { "XPST0001", "${\"1\": }undefined value${: 2}" }, |
1132 | 184 | { "XPST0003", "invalid expression${: 1}" }, | 184 | { "XPST0003", "invalid expression${: 1}" }, |
1133 | 185 | { "XPST0005", "static type must not be empty-sequence()" }, | 185 | { "XPST0005", "static type must not be empty-sequence()" }, |
1135 | 186 | { "XPST0008", "\"$1\": undefined $2" }, | 186 | { "XPST0008", "$1" }, |
1136 | 187 | { "XPST0017", "\"$1\": $2" }, | 187 | { "XPST0017", "\"$1\": $2" }, |
1137 | 188 | { "XPST0051", "\"$1\": not defined as atomic type${: 2}" }, | 188 | { "XPST0051", "\"$1\": not defined as atomic type${: 2}" }, |
1138 | 189 | { "XPST0080", "\"$1\": invalid type for \"cast\" or \"castable\" exression" }, | 189 | { "XPST0080", "\"$1\": invalid type for \"cast\" or \"castable\" exression" }, |
1139 | @@ -276,7 +276,7 @@ | |||
1140 | 276 | { "XUDY0018", "\"$1\": function declared external, non-updating returns non-empty pending update list" }, | 276 | { "XUDY0018", "\"$1\": function declared external, non-updating returns non-empty pending update list" }, |
1141 | 277 | { "XUDY0019", "\"$1\": function declated external, updating returns non-empty data model instance" }, | 277 | { "XUDY0019", "\"$1\": function declated external, updating returns non-empty data model instance" }, |
1142 | 278 | { "XUDY0021", "$1${ 2}" }, | 278 | { "XUDY0021", "$1${ 2}" }, |
1144 | 279 | { "XUDY0023", "\"$1\": namespace binding conflicts with $2=$3" }, | 279 | { "XUDY0023", "\"$1\": qname causes namespace binding conflict: prefix $2 cannot be bound to both $3 and $4" }, |
1145 | 280 | { "XUDY0024", "\"$1\": namespace binding conflicts with $2=$3" }, | 280 | { "XUDY0024", "\"$1\": namespace binding conflicts with $2=$3" }, |
1146 | 281 | { "XUDY0027", "target expression is empty sequence" }, | 281 | { "XUDY0027", "target expression is empty sequence" }, |
1147 | 282 | { "XUDY0029", "node has no parent in \"insert\" expression (with \"before\" or \"after\")" }, | 282 | { "XUDY0029", "node has no parent in \"insert\" expression (with \"before\" or \"after\")" }, |
1148 | @@ -304,7 +304,7 @@ | |||
1149 | 304 | { "ZAPI0007", "cannot serialize pul" }, | 304 | { "ZAPI0007", "cannot serialize pul" }, |
1150 | 305 | { "ZAPI0008", "can not execute a non-updating XQuery" }, | 305 | { "ZAPI0008", "can not execute a non-updating XQuery" }, |
1151 | 306 | { "ZAPI0009", "XQuery not compiled in debug mode" }, | 306 | { "ZAPI0009", "XQuery not compiled in debug mode" }, |
1153 | 307 | { "ZAPI0011", "\"$1\": undefined $2" }, | 307 | { "ZAPI0011", "\"$1\": undeclared variable" }, |
1154 | 308 | { "ZAPI0014", "\"$1\": invalid argument${: 2}" }, | 308 | { "ZAPI0014", "\"$1\": invalid argument${: 2}" }, |
1155 | 309 | { "ZAPI0015", "\"$1\": createModule() function not found${: 2}" }, | 309 | { "ZAPI0015", "\"$1\": createModule() function not found${: 2}" }, |
1156 | 310 | { "ZAPI0019", "\"$1\": external module already registered" }, | 310 | { "ZAPI0019", "\"$1\": external module already registered" }, |
1157 | @@ -784,8 +784,6 @@ | |||
1158 | 784 | #endif | 784 | #endif |
1159 | 785 | { "~SEPM0009_Not10", "the version parameter has a value other than \"1.0\" and the doctype-system parameter is specified" }, | 785 | { "~SEPM0009_Not10", "the version parameter has a value other than \"1.0\" and the doctype-system parameter is specified" }, |
1160 | 786 | { "~SEPM0009_NotOmit", "the standalone attribute has a value other than \"omit\"" }, | 786 | { "~SEPM0009_NotOmit", "the standalone attribute has a value other than \"omit\"" }, |
1161 | 787 | { "~SchemaAttributeName", "schema-attribute name" }, | ||
1162 | 788 | { "~SchemaElementName", "schema-element name" }, | ||
1163 | 789 | { "~SchemaOutOfMemory", "OutOfMemoryException during parsing" }, | 787 | { "~SchemaOutOfMemory", "OutOfMemoryException during parsing" }, |
1164 | 790 | { "~SchemaParseError", "error during parsing" }, | 788 | { "~SchemaParseError", "error during parsing" }, |
1165 | 791 | { "~SchemaUnexpected", "unexpected exception during parsing" }, | 789 | { "~SchemaUnexpected", "unexpected exception during parsing" }, |
1166 | @@ -871,10 +869,10 @@ | |||
1167 | 871 | #endif | 869 | #endif |
1168 | 872 | { "~UnexpectedElement", "unexpected element" }, | 870 | { "~UnexpectedElement", "unexpected element" }, |
1169 | 873 | { "~VarValMustBeSingleItem_2", "\"$2\": variable value must be single item" }, | 871 | { "~VarValMustBeSingleItem_2", "\"$2\": variable value must be single item" }, |
1170 | 874 | { "~Variable", "variable" }, | ||
1171 | 875 | { "~VariabledHasNoValue", "variable has no value" }, | ||
1172 | 876 | { "~VariabledUndeclared", "undeclared variable" }, | ||
1173 | 877 | { "~XMLSchema", "XML schema" }, | 872 | { "~XMLSchema", "XML schema" }, |
1174 | 873 | { "~XPDY0002_ContextUndeclared_2", "$2 not declared" }, | ||
1175 | 874 | { "~XPDY0002_VariableHasNoValue_2", "\"$2\": variable has no value" }, | ||
1176 | 875 | { "~XPDY0002_VariableUndeclared_2", "\"$2\": undeclared variable" }, | ||
1177 | 878 | { "~XPST0003_Annotations", "function and variable annotations only available in XQuery 3.0 or later" }, | 876 | { "~XPST0003_Annotations", "function and variable annotations only available in XQuery 3.0 or later" }, |
1178 | 879 | { "~XPST0003_CountClause30", "\"count\" clause only available in XQuery 3.0 or later" }, | 877 | { "~XPST0003_CountClause30", "\"count\" clause only available in XQuery 3.0 or later" }, |
1179 | 880 | { "~XPST0003_ModuleDeclNotInMain", "module declaration must not be in main module" }, | 878 | { "~XPST0003_ModuleDeclNotInMain", "module declaration must not be in main module" }, |
1180 | @@ -886,6 +884,9 @@ | |||
1181 | 886 | { "~XPST0003_TryCatchExpr30", "\"try/catch\" expressions only available in XQuery 3.0 or later" }, | 884 | { "~XPST0003_TryCatchExpr30", "\"try/catch\" expressions only available in XQuery 3.0 or later" }, |
1182 | 887 | { "~XPST0003_WindowClause30", "\"window\" clause only available in XQuery 3.0 or later" }, | 885 | { "~XPST0003_WindowClause30", "\"window\" clause only available in XQuery 3.0 or later" }, |
1183 | 888 | { "~XPST0003_XQueryVersionAtLeast30_2", "\"$2\": XQuery version must be at least 3.0" }, | 886 | { "~XPST0003_XQueryVersionAtLeast30_2", "\"$2\": XQuery version must be at least 3.0" }, |
1184 | 887 | { "~XPST0008_SchemaAttributeName_2", "\"$2\": undefined schema-attribute name" }, | ||
1185 | 888 | { "~XPST0008_SchemaElementName_2", "\"$2\": undefined schema-element name" }, | ||
1186 | 889 | { "~XPST0008_VariableName_2", "\"$2\": undeclared variable" }, | ||
1187 | 889 | { "~XPTY0004_FormatNumber_2", "first parameter to format-number() function is type $2 that is not allowed" }, | 890 | { "~XPTY0004_FormatNumber_2", "first parameter to format-number() function is type $2 that is not allowed" }, |
1188 | 890 | { "~XPTY0004_JSONIQ_SELECTOR", "can not atomize and/or cast value of type $2 to string" }, | 891 | { "~XPTY0004_JSONIQ_SELECTOR", "can not atomize and/or cast value of type $2 to string" }, |
1189 | 891 | { "~XPTY0004_MultiValuedGroupingKey", "atomization of grouping variable produces more than one item" }, | 892 | { "~XPTY0004_MultiValuedGroupingKey", "atomization of grouping variable produces more than one item" }, |
1190 | 892 | 893 | ||
1191 | === modified file 'src/diagnostics/pregenerated/dict_zed_keys.h' | |||
1192 | --- src/diagnostics/pregenerated/dict_zed_keys.h 2012-12-29 06:48:09 +0000 | |||
1193 | +++ src/diagnostics/pregenerated/dict_zed_keys.h 2013-01-08 11:10:56 +0000 | |||
1194 | @@ -33,6 +33,9 @@ | |||
1195 | 33 | #define ZED_XPST0003_Annotations "~XPST0003_Annotations" | 33 | #define ZED_XPST0003_Annotations "~XPST0003_Annotations" |
1196 | 34 | #define ZED_XPST0003_Scripting "~XPST0003_Scripting" | 34 | #define ZED_XPST0003_Scripting "~XPST0003_Scripting" |
1197 | 35 | #define ZED_XPST0003_PiTarget "~XPST0003_PiTarget" | 35 | #define ZED_XPST0003_PiTarget "~XPST0003_PiTarget" |
1198 | 36 | #define ZED_XPST0008_VariableName_2 "~XPST0008_VariableName_2" | ||
1199 | 37 | #define ZED_XPST0008_SchemaAttributeName_2 "~XPST0008_SchemaAttributeName_2" | ||
1200 | 38 | #define ZED_XPST0008_SchemaElementName_2 "~XPST0008_SchemaElementName_2" | ||
1201 | 36 | #define ZED_XPTY0004_NoReturnTypePromote_234 "~XPTY0004_NoReturnTypePromote_234" | 39 | #define ZED_XPTY0004_NoReturnTypePromote_234 "~XPTY0004_NoReturnTypePromote_234" |
1202 | 37 | #define ZED_XPTY0004_NoParamTypePromote_234 "~XPTY0004_NoParamTypePromote_234" | 40 | #define ZED_XPTY0004_NoParamTypePromote_234 "~XPTY0004_NoParamTypePromote_234" |
1203 | 38 | #define ZED_XPTY0004_NoTypePromote_23 "~XPTY0004_NoTypePromote_23" | 41 | #define ZED_XPTY0004_NoTypePromote_23 "~XPTY0004_NoTypePromote_23" |
1204 | @@ -45,6 +48,9 @@ | |||
1205 | 45 | #define ZED_XPTY0117_NotationParam_23 "~XPTY0117_NotationParam_23" | 48 | #define ZED_XPTY0117_NotationParam_23 "~XPTY0117_NotationParam_23" |
1206 | 46 | #define ZED_XQST0106_THE_SAME "~XQST0106_THE_SAME" | 49 | #define ZED_XQST0106_THE_SAME "~XQST0106_THE_SAME" |
1207 | 47 | #define ZED_XQST0106_CONFLICTING "~XQST0106_CONFLICTING" | 50 | #define ZED_XQST0106_CONFLICTING "~XQST0106_CONFLICTING" |
1208 | 51 | #define ZED_XPDY0002_VariableHasNoValue_2 "~XPDY0002_VariableHasNoValue_2" | ||
1209 | 52 | #define ZED_XPDY0002_VariableUndeclared_2 "~XPDY0002_VariableUndeclared_2" | ||
1210 | 53 | #define ZED_XPDY0002_ContextUndeclared_2 "~XPDY0002_ContextUndeclared_2" | ||
1211 | 48 | #define ZED_FTST0009_BadStopWordsLang "~FTST0009_BadStopWordsLang" | 54 | #define ZED_FTST0009_BadStopWordsLang "~FTST0009_BadStopWordsLang" |
1212 | 49 | #define ZED_FTST0009_BadStemmerLang "~FTST0009_BadStemmerLang" | 55 | #define ZED_FTST0009_BadStemmerLang "~FTST0009_BadStemmerLang" |
1213 | 50 | #define ZED_FTST0009_BadThesaurusLang "~FTST0009_BadThesaurusLang" | 56 | #define ZED_FTST0009_BadThesaurusLang "~FTST0009_BadThesaurusLang" |
1214 | @@ -236,8 +242,6 @@ | |||
1215 | 236 | #define ZED_QuotedColon_23 "~QuotedColon_23" | 242 | #define ZED_QuotedColon_23 "~QuotedColon_23" |
1216 | 237 | #define ZED_SEPM0009_Not10 "~SEPM0009_Not10" | 243 | #define ZED_SEPM0009_Not10 "~SEPM0009_Not10" |
1217 | 238 | #define ZED_SEPM0009_NotOmit "~SEPM0009_NotOmit" | 244 | #define ZED_SEPM0009_NotOmit "~SEPM0009_NotOmit" |
1218 | 239 | #define ZED_SchemaAttributeName "~SchemaAttributeName" | ||
1219 | 240 | #define ZED_SchemaElementName "~SchemaElementName" | ||
1220 | 241 | #define ZED_SchemaOutOfMemory "~SchemaOutOfMemory" | 245 | #define ZED_SchemaOutOfMemory "~SchemaOutOfMemory" |
1221 | 242 | #define ZED_SchemaParseError "~SchemaParseError" | 246 | #define ZED_SchemaParseError "~SchemaParseError" |
1222 | 243 | #define ZED_SchemaUnexpected "~SchemaUnexpected" | 247 | #define ZED_SchemaUnexpected "~SchemaUnexpected" |
1223 | @@ -300,9 +304,6 @@ | |||
1224 | 300 | #define ZED_UnescapedChar_3 "~UnescapedChar_3" | 304 | #define ZED_UnescapedChar_3 "~UnescapedChar_3" |
1225 | 301 | #define ZED_UnexpectedElement "~UnexpectedElement" | 305 | #define ZED_UnexpectedElement "~UnexpectedElement" |
1226 | 302 | #define ZED_VarValMustBeSingleItem_2 "~VarValMustBeSingleItem_2" | 306 | #define ZED_VarValMustBeSingleItem_2 "~VarValMustBeSingleItem_2" |
1227 | 303 | #define ZED_Variable "~Variable" | ||
1228 | 304 | #define ZED_VariabledHasNoValue "~VariabledHasNoValue" | ||
1229 | 305 | #define ZED_VariabledUndeclared "~VariabledUndeclared" | ||
1230 | 306 | #define ZED_XMLSchema "~XMLSchema" | 307 | #define ZED_XMLSchema "~XMLSchema" |
1231 | 307 | #define ZED_XUST0002_Transform "~XUST0002_Transform" | 308 | #define ZED_XUST0002_Transform "~XUST0002_Transform" |
1232 | 308 | #define ZED_XUST0002_UDF_2 "~XUST0002_UDF_2" | 309 | #define ZED_XUST0002_UDF_2 "~XUST0002_UDF_2" |
1233 | 309 | 310 | ||
1234 | === modified file 'src/runtime/core/var_iterators.cpp' | |||
1235 | --- src/runtime/core/var_iterators.cpp 2012-10-08 12:09:36 +0000 | |||
1236 | +++ src/runtime/core/var_iterators.cpp 2013-01-08 11:10:56 +0000 | |||
1237 | @@ -464,7 +464,7 @@ | |||
1238 | 464 | else | 464 | else |
1239 | 465 | { | 465 | { |
1240 | 466 | RAISE_ERROR(err::XPDY0002, loc, | 466 | RAISE_ERROR(err::XPDY0002, loc, |
1242 | 467 | ERROR_PARAMS(theVarName->getStringValue(), ZED(VariabledUndeclared))); | 467 | ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), theVarName->getStringValue())); |
1243 | 468 | } | 468 | } |
1244 | 469 | } // if (theTargetPosIter != NULL && theTargetLenIter == NULL && theInfLen == false) | 469 | } // if (theTargetPosIter != NULL && theTargetLenIter == NULL && theInfLen == false) |
1245 | 470 | 470 | ||
1246 | @@ -532,7 +532,7 @@ | |||
1247 | 532 | else | 532 | else |
1248 | 533 | { | 533 | { |
1249 | 534 | RAISE_ERROR(err::XPDY0002, loc, | 534 | RAISE_ERROR(err::XPDY0002, loc, |
1251 | 535 | ERROR_PARAMS(theVarName->getStringValue(), ZED(VariabledUndeclared))); | 535 | ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), theVarName->getStringValue())); |
1252 | 536 | } | 536 | } |
1253 | 537 | } // if (theTargetPosIter != NULL && theTargetLenIter != NULL) | 537 | } // if (theTargetPosIter != NULL && theTargetLenIter != NULL) |
1254 | 538 | 538 | ||
1255 | @@ -565,7 +565,7 @@ | |||
1256 | 565 | else | 565 | else |
1257 | 566 | { | 566 | { |
1258 | 567 | RAISE_ERROR(err::XPDY0002, loc, | 567 | RAISE_ERROR(err::XPDY0002, loc, |
1260 | 568 | ERROR_PARAMS(theVarName->getStringValue(), ZED(VariabledUndeclared))); | 568 | ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), theVarName->getStringValue())); |
1261 | 569 | } | 569 | } |
1262 | 570 | } // if (theTargetPos > 0) | 570 | } // if (theTargetPos > 0) |
1263 | 571 | 571 | ||
1264 | @@ -596,7 +596,7 @@ | |||
1265 | 596 | else | 596 | else |
1266 | 597 | { | 597 | { |
1267 | 598 | RAISE_ERROR(err::XPDY0002, loc, | 598 | RAISE_ERROR(err::XPDY0002, loc, |
1269 | 599 | ERROR_PARAMS(theVarName->getStringValue(), ZED(VariabledUndeclared))); | 599 | ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), theVarName->getStringValue())); |
1270 | 600 | } | 600 | } |
1271 | 601 | } | 601 | } |
1272 | 602 | 602 | ||
1273 | 603 | 603 | ||
1274 | === modified file 'src/runtime/eval/eval.cpp' | |||
1275 | --- src/runtime/eval/eval.cpp 2012-10-24 11:32:56 +0000 | |||
1276 | +++ src/runtime/eval/eval.cpp 2013-01-08 11:10:56 +0000 | |||
1277 | @@ -310,7 +310,7 @@ | |||
1278 | 310 | ve->set_unique_id(outerGlobalVarId); | 310 | ve->set_unique_id(outerGlobalVarId); |
1279 | 311 | } | 311 | } |
1280 | 312 | 312 | ||
1282 | 313 | importSctx->bind_var(ve, loc, err::XQST0049); | 313 | importSctx->bind_var(ve, loc); |
1283 | 314 | } | 314 | } |
1284 | 315 | 315 | ||
1285 | 316 | // Import the outer-query ns bindings | 316 | // Import the outer-query ns bindings |
1286 | 317 | 317 | ||
1287 | === modified file 'src/runtime/introspection/sctx_impl.cpp' | |||
1288 | --- src/runtime/introspection/sctx_impl.cpp 2012-10-08 12:09:36 +0000 | |||
1289 | +++ src/runtime/introspection/sctx_impl.cpp 2013-01-08 11:10:56 +0000 | |||
1290 | @@ -102,7 +102,7 @@ | |||
1291 | 102 | 102 | ||
1292 | 103 | consumeNext(lName, theChildren[0].getp(), aPlanState); | 103 | consumeNext(lName, theChildren[0].getp(), aPlanState); |
1293 | 104 | 104 | ||
1295 | 105 | if (theSctx->lookup_ns(ns, lName->getStringValue(), loc, zerr::ZXQP0000_NO_ERROR)) | 105 | if (theSctx->lookup_ns(ns, lName->getStringValue(), loc, false)) |
1296 | 106 | { | 106 | { |
1297 | 107 | STACK_PUSH(GENV_ITEMFACTORY->createString(aResult, ns), state); | 107 | STACK_PUSH(GENV_ITEMFACTORY->createString(aResult, ns), state); |
1298 | 108 | } | 108 | } |
1299 | 109 | 109 | ||
1300 | === modified file 'src/runtime/numerics/numerics_impl.cpp' | |||
1301 | --- src/runtime/numerics/numerics_impl.cpp 2012-12-05 04:47:27 +0000 | |||
1302 | +++ src/runtime/numerics/numerics_impl.cpp 2013-01-08 11:10:56 +0000 | |||
1303 | @@ -909,27 +909,34 @@ | |||
1304 | 909 | 909 | ||
1305 | 910 | zstring ns; | 910 | zstring ns; |
1306 | 911 | zstring prefix = tmpFormatName.substr(0, tmpFormatName.find(':')); | 911 | zstring prefix = tmpFormatName.substr(0, tmpFormatName.find(':')); |
1308 | 912 | if (theSctx->lookup_ns(ns, prefix, loc, zerr::ZXQP0000_NO_ERROR)) | 912 | if (theSctx->lookup_ns(ns, prefix, loc, false)) |
1309 | 913 | { | 913 | { |
1311 | 914 | GENV_ITEMFACTORY->createQName(formatName, ns, prefix, tmpFormatName.substr(tmpFormatName.find(':')+1)); | 914 | GENV_ITEMFACTORY->createQName(formatName, |
1312 | 915 | ns, | ||
1313 | 916 | prefix, | ||
1314 | 917 | tmpFormatName.substr(tmpFormatName.find(':')+1)); | ||
1315 | 915 | break; | 918 | break; |
1316 | 916 | } | 919 | } |
1317 | 917 | 920 | ||
1318 | 918 | // The prefix is not in the known namespaces, the only posibility left is for the function to be invoked from an EnclosedIterator | 921 | // The prefix is not in the known namespaces, the only posibility left is for the function to be invoked from an EnclosedIterator |
1319 | 919 | if (planState.theNodeConstuctionPath.empty()) | 922 | if (planState.theNodeConstuctionPath.empty()) |
1320 | 920 | { | 923 | { |
1322 | 921 | throw XQUERY_EXCEPTION(err::FODF1280, ERROR_PARAMS(tmpFormatName), ERROR_LOC(loc)); | 924 | RAISE_ERROR(err::FODF1280, loc, ERROR_PARAMS(tmpFormatName)); |
1323 | 922 | } | 925 | } |
1324 | 923 | 926 | ||
1325 | 924 | store::NsBindings bindings; | 927 | store::NsBindings bindings; |
1326 | 925 | planState.theNodeConstuctionPath.top()->getNamespaceBindings(bindings); | 928 | planState.theNodeConstuctionPath.top()->getNamespaceBindings(bindings); |
1328 | 926 | for (unsigned int i=0; i<bindings.size(); i++) | 929 | for (unsigned int i = 0; i < bindings.size(); i++) |
1329 | 930 | { | ||
1330 | 927 | if (prefix == bindings[i].first) | 931 | if (prefix == bindings[i].first) |
1331 | 928 | { | 932 | { |
1333 | 929 | GENV_ITEMFACTORY->createQName(formatName, bindings[i].second, prefix, tmpFormatName.substr(tmpFormatName.find(':')+1)); | 933 | GENV_ITEMFACTORY->createQName(formatName, |
1334 | 934 | bindings[i].second, | ||
1335 | 935 | prefix, | ||
1336 | 936 | tmpFormatName.substr(tmpFormatName.find(':')+1)); | ||
1337 | 930 | break; | 937 | break; |
1338 | 931 | } | 938 | } |
1340 | 932 | 939 | } | |
1341 | 933 | } while(0); | 940 | } while(0); |
1342 | 934 | 941 | ||
1343 | 935 | if (formatName.isNull()) | 942 | if (formatName.isNull()) |
1344 | 936 | 943 | ||
1345 | === modified file 'src/store/naive/node_items.cpp' | |||
1346 | --- src/store/naive/node_items.cpp 2012-12-14 13:11:08 +0000 | |||
1347 | +++ src/store/naive/node_items.cpp 2013-01-08 11:10:56 +0000 | |||
1348 | @@ -22,8 +22,11 @@ | |||
1349 | 22 | #include <zorba/item.h> | 22 | #include <zorba/item.h> |
1350 | 23 | 23 | ||
1351 | 24 | #include "api/unmarshaller.h" | 24 | #include "api/unmarshaller.h" |
1352 | 25 | |||
1353 | 25 | #include "diagnostics/assert.h" | 26 | #include "diagnostics/assert.h" |
1354 | 27 | #include "diagnostics/util_macros.h" | ||
1355 | 26 | #include "diagnostics/xquery_diagnostics.h" | 28 | #include "diagnostics/xquery_diagnostics.h" |
1356 | 29 | |||
1357 | 27 | #include "zorbatypes/URI.h" | 30 | #include "zorbatypes/URI.h" |
1358 | 28 | #ifndef ZORBA_NO_FULL_TEXT | 31 | #ifndef ZORBA_NO_FULL_TEXT |
1359 | 29 | #include "zorbautils/locale.h" | 32 | #include "zorbautils/locale.h" |
1360 | @@ -3263,7 +3266,7 @@ | |||
1361 | 3263 | ********************************************************************************/ | 3266 | ********************************************************************************/ |
1362 | 3264 | void ElementNode::checkNamespaceConflict( | 3267 | void ElementNode::checkNamespaceConflict( |
1363 | 3265 | const store::Item* qname, | 3268 | const store::Item* qname, |
1365 | 3266 | Error const& ecode) const | 3269 | const QueryLoc* loc) const |
1366 | 3267 | { | 3270 | { |
1367 | 3268 | const QNameItem* qn = reinterpret_cast<const QNameItem*>(qname); | 3271 | const QNameItem* qn = reinterpret_cast<const QNameItem*>(qname); |
1368 | 3269 | 3272 | ||
1369 | @@ -3279,7 +3282,8 @@ | |||
1370 | 3279 | 3282 | ||
1371 | 3280 | if (found && ns2 != ns) | 3283 | if (found && ns2 != ns) |
1372 | 3281 | { | 3284 | { |
1374 | 3282 | throw XQUERY_EXCEPTION_VAR(ecode, ERROR_PARAMS(qname->show(), prefix, ns2)); | 3285 | RAISE_ERROR(err::XUDY0023, loc, |
1375 | 3286 | ERROR_PARAMS(qn->getStringValue(), prefix, ns, ns2)); | ||
1376 | 3283 | } | 3287 | } |
1377 | 3284 | } | 3288 | } |
1378 | 3285 | 3289 | ||
1379 | 3286 | 3290 | ||
1380 | === modified file 'src/store/naive/node_items.h' | |||
1381 | --- src/store/naive/node_items.h 2012-12-14 13:23:51 +0000 | |||
1382 | +++ src/store/naive/node_items.h 2013-01-08 11:10:56 +0000 | |||
1383 | @@ -54,6 +54,9 @@ | |||
1384 | 54 | namespace zorba | 54 | namespace zorba |
1385 | 55 | { | 55 | { |
1386 | 56 | 56 | ||
1387 | 57 | class QueryLoc; | ||
1388 | 58 | |||
1389 | 59 | |||
1390 | 57 | namespace store | 60 | namespace store |
1391 | 58 | { | 61 | { |
1392 | 59 | class CopyMode; | 62 | class CopyMode; |
1393 | @@ -1086,7 +1089,7 @@ | |||
1394 | 1086 | 1089 | ||
1395 | 1087 | void addBindingForQName2(const store::Item* qname); | 1090 | void addBindingForQName2(const store::Item* qname); |
1396 | 1088 | 1091 | ||
1398 | 1089 | void checkNamespaceConflict(const store::Item* qname, Error const &ecode) const; | 1092 | void checkNamespaceConflict(const store::Item* qname, const QueryLoc* loc) const; |
1399 | 1090 | 1093 | ||
1400 | 1091 | void uninheritBinding( | 1094 | void uninheritBinding( |
1401 | 1092 | NsBindingsContext* rootNSCtx, | 1095 | NsBindingsContext* rootNSCtx, |
1402 | 1093 | 1096 | ||
1403 | === modified file 'src/store/naive/pul_primitives.cpp' | |||
1404 | --- src/store/naive/pul_primitives.cpp 2012-12-10 16:02:05 +0000 | |||
1405 | +++ src/store/naive/pul_primitives.cpp 2013-01-08 11:10:56 +0000 | |||
1406 | @@ -1277,17 +1277,17 @@ | |||
1407 | 1277 | ********************************************************************************/ | 1277 | ********************************************************************************/ |
1408 | 1278 | void UpdDeleteNodesFromCollection::apply() | 1278 | void UpdDeleteNodesFromCollection::apply() |
1409 | 1279 | { | 1279 | { |
1411 | 1280 | Collection* lColl = static_cast<Collection*> | 1280 | Collection* coll = static_cast<Collection*> |
1412 | 1281 | (GET_STORE().getCollection(theName, theIsDynamic).getp()); | 1281 | (GET_STORE().getCollection(theName, theIsDynamic).getp()); |
1413 | 1282 | 1282 | ||
1415 | 1283 | assert(lColl); | 1283 | assert(coll); |
1416 | 1284 | 1284 | ||
1417 | 1285 | theIsApplied = true; | 1285 | theIsApplied = true; |
1418 | 1286 | 1286 | ||
1419 | 1287 | uint64_t size; | 1287 | uint64_t size; |
1420 | 1288 | try | 1288 | try |
1421 | 1289 | { | 1289 | { |
1423 | 1290 | size = to_xs_unsignedLong(lColl->size()); | 1290 | size = to_xs_unsignedLong(coll->size()); |
1424 | 1291 | } | 1291 | } |
1425 | 1292 | catch (std::range_error& e) | 1292 | catch (std::range_error& e) |
1426 | 1293 | { | 1293 | { |
1427 | @@ -1304,7 +1304,7 @@ | |||
1428 | 1304 | { | 1304 | { |
1429 | 1305 | for (csize i = numNodes; i > 0; --i) | 1305 | for (csize i = numNodes; i > 0; --i) |
1430 | 1306 | { | 1306 | { |
1432 | 1307 | if (theNodes[i-1] != lColl->nodeAt(xs_integer(size - i))) | 1307 | if (theNodes[i-1] != coll->nodeAt(xs_integer(size - i))) |
1433 | 1308 | { | 1308 | { |
1434 | 1309 | isLast = false; | 1309 | isLast = false; |
1435 | 1310 | break; | 1310 | break; |
1436 | @@ -1320,25 +1320,25 @@ | |||
1437 | 1320 | theFound.resize(numNodes); | 1320 | theFound.resize(numNodes); |
1438 | 1321 | thePositions.resize(numNodes); | 1321 | thePositions.resize(numNodes); |
1439 | 1322 | 1322 | ||
1441 | 1323 | for (std::size_t i = 0; i < numNodes; ++i) | 1323 | for (csize i = 0; i < numNodes; ++i) |
1442 | 1324 | { | 1324 | { |
1444 | 1325 | theFound[i] = lColl->removeNode(theNodes[i], thePositions[i]); | 1325 | theFound[i] = coll->removeNode(theNodes[i], thePositions[i]); |
1445 | 1326 | ++theNumApplied; | 1326 | ++theNumApplied; |
1446 | 1327 | } | 1327 | } |
1447 | 1328 | } | 1328 | } |
1448 | 1329 | 1329 | ||
1449 | 1330 | void UpdDeleteNodesFromCollection::undo() | 1330 | void UpdDeleteNodesFromCollection::undo() |
1450 | 1331 | { | 1331 | { |
1452 | 1332 | Collection* lColl = static_cast<Collection*> | 1332 | Collection* coll = static_cast<Collection*> |
1453 | 1333 | (GET_STORE().getCollection(theName, theIsDynamic).getp()); | 1333 | (GET_STORE().getCollection(theName, theIsDynamic).getp()); |
1454 | 1334 | 1334 | ||
1456 | 1335 | assert(lColl); | 1335 | assert(coll); |
1457 | 1336 | 1336 | ||
1458 | 1337 | for (csize i = 0; i < theNumApplied; ++i) | 1337 | for (csize i = 0; i < theNumApplied; ++i) |
1459 | 1338 | { | 1338 | { |
1460 | 1339 | if (theFound[i]) | 1339 | if (theFound[i]) |
1461 | 1340 | { | 1340 | { |
1463 | 1341 | lColl->addNode(theNodes[i], thePositions[i]); | 1341 | coll->addNode(theNodes[i], thePositions[i]); |
1464 | 1342 | } | 1342 | } |
1465 | 1343 | } | 1343 | } |
1466 | 1344 | } | 1344 | } |
1467 | @@ -1349,11 +1349,13 @@ | |||
1468 | 1349 | ********************************************************************************/ | 1349 | ********************************************************************************/ |
1469 | 1350 | void UpdEditInCollection::apply() | 1350 | void UpdEditInCollection::apply() |
1470 | 1351 | { | 1351 | { |
1472 | 1352 | Collection* lColl = static_cast<Collection*> | 1352 | #ifndef NDEBUG |
1473 | 1353 | Collection* coll = static_cast<Collection*> | ||
1474 | 1353 | (GET_STORE().getCollection(theName, theIsDynamic).getp()); | 1354 | (GET_STORE().getCollection(theName, theIsDynamic).getp()); |
1475 | 1354 | 1355 | ||
1478 | 1355 | assert(lColl); | 1356 | assert(coll); |
1479 | 1356 | 1357 | #endif | |
1480 | 1358 | |||
1481 | 1357 | theTarget->swap(theContent.getp()); | 1359 | theTarget->swap(theContent.getp()); |
1482 | 1358 | 1360 | ||
1483 | 1359 | theIsApplied = true; | 1361 | theIsApplied = true; |
1484 | @@ -1363,13 +1365,14 @@ | |||
1485 | 1363 | void UpdEditInCollection::undo() | 1365 | void UpdEditInCollection::undo() |
1486 | 1364 | { | 1366 | { |
1487 | 1365 | if (!theFound) | 1367 | if (!theFound) |
1488 | 1366 | { | ||
1489 | 1367 | return; | 1368 | return; |
1492 | 1368 | } | 1369 | |
1493 | 1369 | Collection* lColl = static_cast<Collection*> | 1370 | #ifndef NDEBUG |
1494 | 1371 | Collection* coll = static_cast<Collection*> | ||
1495 | 1370 | (GET_STORE().getCollection(theName, theIsDynamic).getp()); | 1372 | (GET_STORE().getCollection(theName, theIsDynamic).getp()); |
1496 | 1371 | 1373 | ||
1498 | 1372 | assert(lColl); | 1374 | assert(coll); |
1499 | 1375 | #endif | ||
1500 | 1373 | 1376 | ||
1501 | 1374 | theTarget->swap(theContent.getp()); | 1377 | theTarget->swap(theContent.getp()); |
1502 | 1375 | } | 1378 | } |
1503 | 1376 | 1379 | ||
1504 | === modified file 'src/store/naive/simple_pul.cpp' | |||
1505 | --- src/store/naive/simple_pul.cpp 2012-12-10 16:02:05 +0000 | |||
1506 | +++ src/store/naive/simple_pul.cpp 2013-01-08 11:10:56 +0000 | |||
1507 | @@ -392,7 +392,7 @@ | |||
1508 | 392 | 392 | ||
1509 | 393 | ********************************************************************************/ | 393 | ********************************************************************************/ |
1510 | 394 | void PULImpl::addInsertAttributes( | 394 | void PULImpl::addInsertAttributes( |
1512 | 395 | const QueryLoc* aQueryLoc, | 395 | const QueryLoc* loc, |
1513 | 396 | store::Item_t& target, | 396 | store::Item_t& target, |
1514 | 397 | std::vector<store::Item_t>& attrs) | 397 | std::vector<store::Item_t>& attrs) |
1515 | 398 | { | 398 | { |
1516 | @@ -401,16 +401,16 @@ | |||
1517 | 401 | ElementNode* n = ELEM_NODE(target); | 401 | ElementNode* n = ELEM_NODE(target); |
1518 | 402 | 402 | ||
1519 | 403 | csize numAttrs = attrs.size(); | 403 | csize numAttrs = attrs.size(); |
1521 | 404 | for (csize i = 0; i < numAttrs; i++) | 404 | for (csize i = 0; i < numAttrs; ++i) |
1522 | 405 | { | 405 | { |
1524 | 406 | n->checkNamespaceConflict(attrs[i]->getNodeName(), err::XUDY0023); | 406 | n->checkNamespaceConflict(attrs[i]->getNodeName(), loc); |
1525 | 407 | } | 407 | } |
1526 | 408 | 408 | ||
1527 | 409 | NodeUpdates* updates = 0; | 409 | NodeUpdates* updates = 0; |
1528 | 410 | bool found = pul->theNodeToUpdatesMap.get(n, updates); | 410 | bool found = pul->theNodeToUpdatesMap.get(n, updates); |
1529 | 411 | 411 | ||
1530 | 412 | UpdInsertAttributes* upd = GET_PUL_FACTORY(). | 412 | UpdInsertAttributes* upd = GET_PUL_FACTORY(). |
1532 | 413 | createUpdInsertAttributes(pul, aQueryLoc, target, attrs); | 413 | createUpdInsertAttributes(pul, loc, target, attrs); |
1533 | 414 | 414 | ||
1534 | 415 | pul->theDoFirstList.push_back(upd); | 415 | pul->theDoFirstList.push_back(upd); |
1535 | 416 | 416 | ||
1536 | @@ -431,7 +431,7 @@ | |||
1537 | 431 | 431 | ||
1538 | 432 | ********************************************************************************/ | 432 | ********************************************************************************/ |
1539 | 433 | void PULImpl::addReplaceNode( | 433 | void PULImpl::addReplaceNode( |
1541 | 434 | const QueryLoc* aQueryLoc, | 434 | const QueryLoc* loc, |
1542 | 435 | store::Item_t& target, | 435 | store::Item_t& target, |
1543 | 436 | std::vector<store::Item_t>& newNodes) | 436 | std::vector<store::Item_t>& newNodes) |
1544 | 437 | { | 437 | { |
1545 | @@ -456,19 +456,19 @@ | |||
1546 | 456 | csize numNewAttrs = newNodes.size(); | 456 | csize numNewAttrs = newNodes.size(); |
1547 | 457 | for (csize i = 0; i < numNewAttrs; ++i) | 457 | for (csize i = 0; i < numNewAttrs; ++i) |
1548 | 458 | { | 458 | { |
1550 | 459 | elemParent->checkNamespaceConflict(newNodes[i]->getNodeName(), err::XUDY0023); | 459 | elemParent->checkNamespaceConflict(newNodes[i]->getNodeName(), loc); |
1551 | 460 | } | 460 | } |
1552 | 461 | } | 461 | } |
1553 | 462 | 462 | ||
1554 | 463 | upd = GET_PUL_FACTORY(). | 463 | upd = GET_PUL_FACTORY(). |
1556 | 464 | createUpdReplaceAttribute(pul, aQueryLoc, parent, target, newNodes); | 464 | createUpdReplaceAttribute(pul, loc, parent, target, newNodes); |
1557 | 465 | 465 | ||
1558 | 466 | kind = store::UpdateConsts::UP_REPLACE_ATTRIBUTE; | 466 | kind = store::UpdateConsts::UP_REPLACE_ATTRIBUTE; |
1559 | 467 | } | 467 | } |
1560 | 468 | else | 468 | else |
1561 | 469 | { | 469 | { |
1562 | 470 | upd = GET_PUL_FACTORY(). | 470 | upd = GET_PUL_FACTORY(). |
1564 | 471 | createUpdReplaceChild(pul, aQueryLoc, parent, target, newNodes); | 471 | createUpdReplaceChild(pul, loc, parent, target, newNodes); |
1565 | 472 | 472 | ||
1566 | 473 | kind = store::UpdateConsts::UP_REPLACE_CHILD; | 473 | kind = store::UpdateConsts::UP_REPLACE_CHILD; |
1567 | 474 | } | 474 | } |
1568 | @@ -614,7 +614,7 @@ | |||
1569 | 614 | 614 | ||
1570 | 615 | ********************************************************************************/ | 615 | ********************************************************************************/ |
1571 | 616 | void PULImpl::addRename( | 616 | void PULImpl::addRename( |
1573 | 617 | const QueryLoc* aQueryLoc, | 617 | const QueryLoc* loc, |
1574 | 618 | store::Item_t& target, | 618 | store::Item_t& target, |
1575 | 619 | store::Item_t& newName) | 619 | store::Item_t& newName) |
1576 | 620 | { | 620 | { |
1577 | @@ -632,10 +632,9 @@ | |||
1578 | 632 | case store::StoreConsts::elementNode: | 632 | case store::StoreConsts::elementNode: |
1579 | 633 | { | 633 | { |
1580 | 634 | ElementNode* elemTarget = ELEM_NODE(target); | 634 | ElementNode* elemTarget = ELEM_NODE(target); |
1582 | 635 | elemTarget->checkNamespaceConflict(newName.getp(), err::XUDY0023); | 635 | elemTarget->checkNamespaceConflict(newName.getp(), loc); |
1583 | 636 | 636 | ||
1586 | 637 | upd = GET_PUL_FACTORY(). | 637 | upd = GET_PUL_FACTORY().createUpdRenameElem(pul, loc, target, newName); |
1585 | 638 | createUpdRenameElem(pul, aQueryLoc, target, newName); | ||
1587 | 639 | break; | 638 | break; |
1588 | 640 | } | 639 | } |
1589 | 641 | case store::StoreConsts::attributeNode: | 640 | case store::StoreConsts::attributeNode: |
1590 | @@ -643,16 +642,16 @@ | |||
1591 | 643 | ElementNode* elemParent = reinterpret_cast<ElementNode*>(n->theParent); | 642 | ElementNode* elemParent = reinterpret_cast<ElementNode*>(n->theParent); |
1592 | 644 | 643 | ||
1593 | 645 | if (elemParent != NULL) | 644 | if (elemParent != NULL) |
1595 | 646 | elemParent->checkNamespaceConflict(newName.getp(), err::XUDY0023); | 645 | elemParent->checkNamespaceConflict(newName.getp(), loc); |
1596 | 647 | 646 | ||
1598 | 648 | upd = GET_PUL_FACTORY().createUpdRenameAttr(pul, aQueryLoc, target, newName); | 647 | upd = GET_PUL_FACTORY().createUpdRenameAttr(pul, loc, target, newName); |
1599 | 649 | break; | 648 | break; |
1600 | 650 | } | 649 | } |
1601 | 651 | case store::StoreConsts::piNode: | 650 | case store::StoreConsts::piNode: |
1602 | 652 | { | 651 | { |
1603 | 653 | zstring tmp; | 652 | zstring tmp; |
1604 | 654 | newName->getStringValue2(tmp); | 653 | newName->getStringValue2(tmp); |
1606 | 655 | upd = GET_PUL_FACTORY().createUpdRenamePi(pul, aQueryLoc, target, tmp); | 654 | upd = GET_PUL_FACTORY().createUpdRenamePi(pul, loc, target, tmp); |
1607 | 656 | break; | 655 | break; |
1608 | 657 | } | 656 | } |
1609 | 658 | default: | 657 | default: |
1610 | @@ -670,7 +669,7 @@ | |||
1611 | 670 | else | 669 | else |
1612 | 671 | { | 670 | { |
1613 | 672 | csize numUpdates = updates->size(); | 671 | csize numUpdates = updates->size(); |
1615 | 673 | for (csize i = 0; i < numUpdates; i++) | 672 | for (csize i = 0; i < numUpdates; ++i) |
1616 | 674 | { | 673 | { |
1617 | 675 | if (store::UpdateConsts::isRename((*updates)[i]->getKind())) | 674 | if (store::UpdateConsts::isRename((*updates)[i]->getKind())) |
1618 | 676 | { | 675 | { |
1619 | 677 | 676 | ||
1620 | === modified file 'src/types/casting.cpp' | |||
1621 | --- src/types/casting.cpp 2012-12-29 06:48:09 +0000 | |||
1622 | +++ src/types/casting.cpp 2013-01-08 11:10:56 +0000 | |||
1623 | @@ -2371,7 +2371,7 @@ | |||
1624 | 2371 | xqtref_t sourceType = tm->create_named_type(item->getType(), | 2371 | xqtref_t sourceType = tm->create_named_type(item->getType(), |
1625 | 2372 | TypeConstants::QUANT_ONE, | 2372 | TypeConstants::QUANT_ONE, |
1626 | 2373 | loc, | 2373 | loc, |
1628 | 2374 | err::XPTY0004); | 2374 | true); |
1629 | 2375 | 2375 | ||
1630 | 2376 | ZORBA_ASSERT(item->isAtomic()); | 2376 | ZORBA_ASSERT(item->isAtomic()); |
1631 | 2377 | ZORBA_ASSERT(sourceType != NULL); | 2377 | ZORBA_ASSERT(sourceType != NULL); |
1632 | @@ -2709,7 +2709,7 @@ | |||
1633 | 2709 | xqtref_t lSourceType = tm->create_named_type(aItem->getType(), | 2709 | xqtref_t lSourceType = tm->create_named_type(aItem->getType(), |
1634 | 2710 | TypeConstants::QUANT_ONE, | 2710 | TypeConstants::QUANT_ONE, |
1635 | 2711 | QueryLoc::null, | 2711 | QueryLoc::null, |
1637 | 2712 | err::XPTY0004); | 2712 | true); |
1638 | 2713 | 2713 | ||
1639 | 2714 | TypeConstants::castable_t lIsCastable = TypeOps::castability(*lSourceType, | 2714 | TypeConstants::castable_t lIsCastable = TypeOps::castability(*lSourceType, |
1640 | 2715 | *targetType); | 2715 | *targetType); |
1641 | 2716 | 2716 | ||
1642 | === modified file 'src/types/schema/revalidateUtils.cpp' | |||
1643 | --- src/types/schema/revalidateUtils.cpp 2012-12-28 10:24:59 +0000 | |||
1644 | +++ src/types/schema/revalidateUtils.cpp 2013-01-08 11:10:56 +0000 | |||
1645 | @@ -497,7 +497,8 @@ | |||
1646 | 497 | { | 497 | { |
1647 | 498 | xqtref_t type = typeManager->create_named_atomic_type(typeQName, | 498 | xqtref_t type = typeManager->create_named_atomic_type(typeQName, |
1648 | 499 | TypeConstants::QUANT_ONE, | 499 | TypeConstants::QUANT_ONE, |
1650 | 500 | loc); | 500 | loc, |
1651 | 501 | false); | ||
1652 | 501 | //cout << " vup - processTextValue: '" << textValue->c_str() << "'\n"; | 502 | //cout << " vup - processTextValue: '" << textValue->c_str() << "'\n"; |
1653 | 502 | //cout << " vup - processTextValue: " << typeQName->getPrefix()->str() | 503 | //cout << " vup - processTextValue: " << typeQName->getPrefix()->str() |
1654 | 503 | // << ":" << typeQName->getLocalName()->str() << "@" | 504 | // << ":" << typeQName->getLocalName()->str() << "@" |
1655 | 504 | 505 | ||
1656 | === modified file 'src/types/schema/schema.cpp' | |||
1657 | --- src/types/schema/schema.cpp 2012-12-28 11:53:57 +0000 | |||
1658 | +++ src/types/schema/schema.cpp 2013-01-08 11:10:56 +0000 | |||
1659 | @@ -513,11 +513,8 @@ | |||
1660 | 513 | 513 | ||
1661 | 514 | if (!typeDef) | 514 | if (!typeDef) |
1662 | 515 | { | 515 | { |
1668 | 516 | throw XQUERY_EXCEPTION( | 516 | RAISE_ERROR(err::XPST0008, loc, |
1669 | 517 | err::XPST0008, | 517 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), qname->getStringValue())); |
1665 | 518 | ERROR_PARAMS( qname->getStringValue(), ZED( SchemaElementName ) ), | ||
1666 | 519 | ERROR_LOC( loc ) | ||
1667 | 520 | ); | ||
1670 | 521 | } | 518 | } |
1671 | 522 | 519 | ||
1672 | 523 | const XMLCh* typeNameStr = typeDef->getName(); | 520 | const XMLCh* typeNameStr = typeDef->getName(); |
1673 | @@ -542,11 +539,8 @@ | |||
1674 | 542 | 539 | ||
1675 | 543 | if (!typeDef) | 540 | if (!typeDef) |
1676 | 544 | { | 541 | { |
1682 | 545 | throw XQUERY_EXCEPTION( | 542 | RAISE_ERROR(err::XPST0008, loc, |
1683 | 546 | err::XPST0008, | 543 | ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), qname->getStringValue())); |
1679 | 547 | ERROR_PARAMS( qname->getStringValue(), ZED( SchemaAttributeName ) ), | ||
1680 | 548 | ERROR_LOC( loc ) | ||
1681 | 549 | ); | ||
1684 | 550 | } | 544 | } |
1685 | 551 | 545 | ||
1686 | 552 | const XMLCh* typeNameStr = typeDef->getName(); | 546 | const XMLCh* typeNameStr = typeDef->getName(); |
1687 | @@ -579,11 +573,8 @@ | |||
1688 | 579 | 573 | ||
1689 | 580 | if (!typeDef) | 574 | if (!typeDef) |
1690 | 581 | { | 575 | { |
1696 | 582 | throw XQUERY_EXCEPTION( | 576 | RAISE_ERROR(err::XPST0008, loc, |
1697 | 583 | err::XPST0008, | 577 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), qname->getStringValue())); |
1693 | 584 | ERROR_PARAMS( qname->getStringValue(), ZED( SchemaElementName ) ), | ||
1694 | 585 | ERROR_LOC( loc ) | ||
1695 | 586 | ); | ||
1698 | 587 | } | 578 | } |
1699 | 588 | 579 | ||
1700 | 589 | xqtref_t res = createXQTypeFromTypeDefinition(typeManager, typeDef); | 580 | xqtref_t res = createXQTypeFromTypeDefinition(typeManager, typeDef); |
1701 | @@ -611,11 +602,8 @@ | |||
1702 | 611 | 602 | ||
1703 | 612 | if (!typeDef) | 603 | if (!typeDef) |
1704 | 613 | { | 604 | { |
1710 | 614 | throw XQUERY_EXCEPTION( | 605 | RAISE_ERROR(err::XPST0008, loc, |
1711 | 615 | err::XPST0008, | 606 | ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), qname->getStringValue())); |
1707 | 616 | ERROR_PARAMS( qname->getStringValue(), ZED( SchemaAttributeName ) ), | ||
1708 | 617 | ERROR_LOC( loc ) | ||
1709 | 618 | ); | ||
1712 | 619 | } | 607 | } |
1713 | 620 | 608 | ||
1714 | 621 | return createXQTypeFromTypeDefinition(typeManager, typeDef); | 609 | return createXQTypeFromTypeDefinition(typeManager, typeDef); |
1715 | 622 | 610 | ||
1716 | === modified file 'src/types/typeimpl.cpp' | |||
1717 | --- src/types/typeimpl.cpp 2013-01-03 09:04:01 +0000 | |||
1718 | +++ src/types/typeimpl.cpp 2013-01-08 11:10:56 +0000 | |||
1719 | @@ -883,7 +883,7 @@ | |||
1720 | 883 | xqtref_t subContentType = tm->create_named_type(subitem->getType(), | 883 | xqtref_t subContentType = tm->create_named_type(subitem->getType(), |
1721 | 884 | TypeConstants::QUANT_ONE, | 884 | TypeConstants::QUANT_ONE, |
1722 | 885 | loc, | 885 | loc, |
1724 | 886 | err::XPTY0004); | 886 | true); |
1725 | 887 | 887 | ||
1726 | 888 | return TypeOps::is_subtype(tm, *subContentType, *theContentType); | 888 | return TypeOps::is_subtype(tm, *subContentType, *theContentType); |
1727 | 889 | } | 889 | } |
1728 | 890 | 890 | ||
1729 | === modified file 'src/types/typemanager.h' | |||
1730 | --- src/types/typemanager.h 2012-12-18 15:57:51 +0000 | |||
1731 | +++ src/types/typemanager.h 2013-01-08 11:10:56 +0000 | |||
1732 | @@ -111,7 +111,7 @@ | |||
1733 | 111 | store::Item* qname, | 111 | store::Item* qname, |
1734 | 112 | TypeConstants::quantifier_t q, | 112 | TypeConstants::quantifier_t q, |
1735 | 113 | const QueryLoc& loc, | 113 | const QueryLoc& loc, |
1737 | 114 | const Error& error = zerr::ZXQP0000_NO_ERROR) const = 0; | 114 | bool raiseError) const = 0; |
1738 | 115 | 115 | ||
1739 | 116 | virtual xqtref_t create_named_simple_type( | 116 | virtual xqtref_t create_named_simple_type( |
1740 | 117 | store::Item* qname) const = 0; | 117 | store::Item* qname) const = 0; |
1741 | @@ -120,7 +120,7 @@ | |||
1742 | 120 | store::Item* qname, | 120 | store::Item* qname, |
1743 | 121 | TypeConstants::quantifier_t q, | 121 | TypeConstants::quantifier_t q, |
1744 | 122 | const QueryLoc& loc, | 122 | const QueryLoc& loc, |
1746 | 123 | const Error& error = zerr::ZXQP0000_NO_ERROR) const = 0; | 123 | bool raiseError = false) const = 0; |
1747 | 124 | 124 | ||
1748 | 125 | virtual xqtref_t create_structured_item_type(TypeConstants::quantifier_t q) const = 0; | 125 | virtual xqtref_t create_structured_item_type(TypeConstants::quantifier_t q) const = 0; |
1749 | 126 | 126 | ||
1750 | 127 | 127 | ||
1751 | === modified file 'src/types/typemanagerimpl.cpp' | |||
1752 | --- src/types/typemanagerimpl.cpp 2012-12-28 10:24:59 +0000 | |||
1753 | +++ src/types/typemanagerimpl.cpp 2013-01-08 11:10:56 +0000 | |||
1754 | @@ -246,7 +246,7 @@ | |||
1755 | 246 | store::Item* qname, | 246 | store::Item* qname, |
1756 | 247 | TypeConstants::quantifier_t quantifier, | 247 | TypeConstants::quantifier_t quantifier, |
1757 | 248 | const QueryLoc& loc, | 248 | const QueryLoc& loc, |
1759 | 249 | const Error& error) const | 249 | bool raiseError) const |
1760 | 250 | { | 250 | { |
1761 | 251 | // Try to resolve the type name as a builtin atomic type | 251 | // Try to resolve the type name as a builtin atomic type |
1762 | 252 | RootTypeManager::qnametype_map_t& myMap = GENV_TYPESYSTEM.m_atomic_qnametype_map; | 252 | RootTypeManager::qnametype_map_t& myMap = GENV_TYPESYSTEM.m_atomic_qnametype_map; |
1763 | @@ -260,11 +260,10 @@ | |||
1764 | 260 | // type (because, otherwise it would have been found above). So we return NULL. | 260 | // type (because, otherwise it would have been found above). So we return NULL. |
1765 | 261 | if (ZSTREQ(qname->getNamespace(), XML_SCHEMA_NS)) | 261 | if (ZSTREQ(qname->getNamespace(), XML_SCHEMA_NS)) |
1766 | 262 | { | 262 | { |
1768 | 263 | if (error != zerr::ZXQP0000_NO_ERROR) | 263 | if (raiseError) |
1769 | 264 | { | 264 | { |
1773 | 265 | throw XQUERY_EXCEPTION_VAR(error, | 265 | RAISE_ERROR(err::XPTY0004, loc, |
1774 | 266 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes)), | 266 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); |
1772 | 267 | ERROR_LOC(loc)); | ||
1775 | 268 | } | 267 | } |
1776 | 269 | else | 268 | else |
1777 | 270 | { | 269 | { |
1778 | @@ -281,11 +280,10 @@ | |||
1779 | 281 | 280 | ||
1780 | 282 | if (namedType == NULL) | 281 | if (namedType == NULL) |
1781 | 283 | { | 282 | { |
1783 | 284 | if (error != zerr::ZXQP0000_NO_ERROR) | 283 | if (raiseError) |
1784 | 285 | { | 284 | { |
1788 | 286 | throw XQUERY_EXCEPTION_VAR(error, | 285 | RAISE_ERROR(err::XPTY0004, loc, |
1789 | 287 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes)), | 286 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); |
1787 | 288 | ERROR_LOC(loc)); | ||
1790 | 289 | } | 287 | } |
1791 | 290 | else | 288 | else |
1792 | 291 | { | 289 | { |
1793 | @@ -303,11 +301,10 @@ | |||
1794 | 303 | } | 301 | } |
1795 | 304 | #endif | 302 | #endif |
1796 | 305 | 303 | ||
1798 | 306 | if (error != zerr::ZXQP0000_NO_ERROR) | 304 | if (raiseError) |
1799 | 307 | { | 305 | { |
1803 | 308 | throw XQUERY_EXCEPTION_VAR(error, | 306 | RAISE_ERROR(err::XPTY0004, loc, |
1804 | 309 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes)), | 307 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); |
1802 | 310 | ERROR_LOC(loc)); | ||
1805 | 311 | } | 308 | } |
1806 | 312 | else | 309 | else |
1807 | 313 | { | 310 | { |
1808 | @@ -387,7 +384,7 @@ | |||
1809 | 387 | store::Item* qname, | 384 | store::Item* qname, |
1810 | 388 | TypeConstants::quantifier_t quant, | 385 | TypeConstants::quantifier_t quant, |
1811 | 389 | const QueryLoc& loc, | 386 | const QueryLoc& loc, |
1813 | 390 | const Error& error) const | 387 | bool raiseError) const |
1814 | 391 | { | 388 | { |
1815 | 392 | RootTypeManager& RTM = GENV_TYPESYSTEM; | 389 | RootTypeManager& RTM = GENV_TYPESYSTEM; |
1816 | 393 | 390 | ||
1817 | @@ -422,11 +419,10 @@ | |||
1818 | 422 | 419 | ||
1819 | 423 | if (namedType == NULL) | 420 | if (namedType == NULL) |
1820 | 424 | { | 421 | { |
1822 | 425 | if (error != zerr::ZXQP0000_NO_ERROR) | 422 | if (raiseError) |
1823 | 426 | { | 423 | { |
1827 | 427 | throw XQUERY_EXCEPTION_VAR(error, | 424 | RAISE_ERROR(err::XPTY0004, loc, |
1828 | 428 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes)), | 425 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); |
1826 | 429 | ERROR_LOC(loc)); | ||
1829 | 430 | } | 426 | } |
1830 | 431 | else | 427 | else |
1831 | 432 | { | 428 | { |
1832 | @@ -440,11 +436,10 @@ | |||
1833 | 440 | } | 436 | } |
1834 | 441 | #endif | 437 | #endif |
1835 | 442 | 438 | ||
1837 | 443 | if (error != zerr::ZXQP0000_NO_ERROR) | 439 | if (raiseError) |
1838 | 444 | { | 440 | { |
1842 | 445 | throw XQUERY_EXCEPTION_VAR(error, | 441 | RAISE_ERROR(err::XPTY0004, loc, |
1843 | 446 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes)), | 442 | ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); |
1841 | 447 | ERROR_LOC(loc)); | ||
1844 | 448 | } | 443 | } |
1845 | 449 | else | 444 | else |
1846 | 450 | { | 445 | { |
1847 | @@ -726,7 +721,7 @@ | |||
1848 | 726 | return create_named_atomic_type(item->getType(), | 721 | return create_named_atomic_type(item->getType(), |
1849 | 727 | quant, | 722 | quant, |
1850 | 728 | loc, | 723 | loc, |
1852 | 729 | err::XPTY0004); | 724 | true); |
1853 | 730 | } | 725 | } |
1854 | 731 | else if (item->isNode()) | 726 | else if (item->isNode()) |
1855 | 732 | { | 727 | { |
1856 | @@ -740,7 +735,7 @@ | |||
1857 | 740 | xqtref_t contentType = create_named_type(item->getType(), | 735 | xqtref_t contentType = create_named_type(item->getType(), |
1858 | 741 | quant, | 736 | quant, |
1859 | 742 | loc, | 737 | loc, |
1861 | 743 | err::XPTY0004); | 738 | true); |
1862 | 744 | 739 | ||
1863 | 745 | return create_node_type(nodeKind, | 740 | return create_node_type(nodeKind, |
1864 | 746 | item->getNodeName(), | 741 | item->getNodeName(), |
1865 | @@ -848,11 +843,8 @@ | |||
1866 | 848 | { | 843 | { |
1867 | 849 | if (m_schema == NULL) | 844 | if (m_schema == NULL) |
1868 | 850 | { | 845 | { |
1874 | 851 | throw XQUERY_EXCEPTION( | 846 | RAISE_ERROR(err::XPST0008, loc, |
1875 | 852 | err::XPST0008, | 847 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), elemName->getStringValue())); |
1871 | 853 | ERROR_PARAMS( elemName->getStringValue(), ZED( SchemaElementName ) ), | ||
1872 | 854 | ERROR_LOC( loc ) | ||
1873 | 855 | ); | ||
1876 | 856 | } | 848 | } |
1877 | 857 | 849 | ||
1878 | 858 | xqtref_t contentType = | 850 | xqtref_t contentType = |
1879 | @@ -878,7 +870,7 @@ | |||
1880 | 878 | if (m_schema == NULL) | 870 | if (m_schema == NULL) |
1881 | 879 | { | 871 | { |
1882 | 880 | RAISE_ERROR(err::XPST0008, loc, | 872 | RAISE_ERROR(err::XPST0008, loc, |
1884 | 881 | ERROR_PARAMS(elemName->getStringValue(), ZED(SchemaElementName))); | 873 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), elemName->getStringValue())); |
1885 | 882 | } | 874 | } |
1886 | 883 | 875 | ||
1887 | 884 | m_schema->getTypeNameFromElementName(elemName, typeName, loc); | 876 | m_schema->getTypeNameFromElementName(elemName, typeName, loc); |
1888 | @@ -899,7 +891,7 @@ | |||
1889 | 899 | if (m_schema == NULL) | 891 | if (m_schema == NULL) |
1890 | 900 | { | 892 | { |
1891 | 901 | RAISE_ERROR(err::XPST0008, loc, | 893 | RAISE_ERROR(err::XPST0008, loc, |
1893 | 902 | ERROR_PARAMS(attrName->getStringValue(), ZED(SchemaAttributeName))); | 894 | ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), attrName->getStringValue())); |
1894 | 903 | } | 895 | } |
1895 | 904 | 896 | ||
1896 | 905 | xqtref_t contentType = | 897 | xqtref_t contentType = |
1897 | @@ -926,7 +918,7 @@ | |||
1898 | 926 | if (m_schema == NULL) | 918 | if (m_schema == NULL) |
1899 | 927 | { | 919 | { |
1900 | 928 | RAISE_ERROR(err::XPST0008, loc, | 920 | RAISE_ERROR(err::XPST0008, loc, |
1902 | 929 | ERROR_PARAMS(attrName->getStringValue(), ZED(SchemaAttributeName))); | 921 | ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), attrName->getStringValue())); |
1903 | 930 | } | 922 | } |
1904 | 931 | 923 | ||
1905 | 932 | m_schema->getTypeNameFromAttributeName(attrName, typeName, loc); | 924 | m_schema->getTypeNameFromAttributeName(attrName, typeName, loc); |
1906 | @@ -1105,7 +1097,7 @@ | |||
1907 | 1105 | ident.getUri().c_str(), | 1097 | ident.getUri().c_str(), |
1908 | 1106 | NULL, | 1098 | NULL, |
1909 | 1107 | ident.getLocalName().c_str()); | 1099 | ident.getLocalName().c_str()); |
1911 | 1108 | return create_named_type(i, q, QueryLoc::null, err::XPTY0004); | 1100 | return create_named_type(i, q, QueryLoc::null, true); |
1912 | 1109 | } | 1101 | } |
1913 | 1110 | 1102 | ||
1914 | 1111 | case IdentTypes::ELEMENT_TYPE: | 1103 | case IdentTypes::ELEMENT_TYPE: |
1915 | 1112 | 1104 | ||
1916 | === modified file 'src/types/typemanagerimpl.h' | |||
1917 | --- src/types/typemanagerimpl.h 2012-12-28 10:24:59 +0000 | |||
1918 | +++ src/types/typemanagerimpl.h 2013-01-08 11:10:56 +0000 | |||
1919 | @@ -108,7 +108,7 @@ | |||
1920 | 108 | store::Item* qname, | 108 | store::Item* qname, |
1921 | 109 | TypeConstants::quantifier_t quant, | 109 | TypeConstants::quantifier_t quant, |
1922 | 110 | const QueryLoc& loc, | 110 | const QueryLoc& loc, |
1924 | 111 | const Error& error = zerr::ZXQP0000_NO_ERROR) const; | 111 | bool raiseError) const; |
1925 | 112 | 112 | ||
1926 | 113 | virtual xqtref_t create_named_simple_type( | 113 | virtual xqtref_t create_named_simple_type( |
1927 | 114 | store::Item* qname) const; | 114 | store::Item* qname) const; |
1928 | @@ -117,7 +117,7 @@ | |||
1929 | 117 | store::Item* qname, | 117 | store::Item* qname, |
1930 | 118 | TypeConstants::quantifier_t quant, | 118 | TypeConstants::quantifier_t quant, |
1931 | 119 | const QueryLoc& loc, | 119 | const QueryLoc& loc, |
1933 | 120 | const Error& error = zerr::ZXQP0000_NO_ERROR) const; | 120 | bool raiseError = false) const; |
1934 | 121 | 121 | ||
1935 | 122 | xqtref_t create_structured_item_type(TypeConstants::quantifier_t q) const; | 122 | xqtref_t create_structured_item_type(TypeConstants::quantifier_t q) const; |
1936 | 123 | 123 | ||
1937 | 124 | 124 | ||
1938 | === modified file 'src/types/typeops.cpp' | |||
1939 | --- src/types/typeops.cpp 2012-12-28 10:24:59 +0000 | |||
1940 | +++ src/types/typeops.cpp 2013-01-08 11:10:56 +0000 | |||
1941 | @@ -777,7 +777,7 @@ | |||
1942 | 777 | xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), | 777 | xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), |
1943 | 778 | TypeConstants::QUANT_ONE, | 778 | TypeConstants::QUANT_ONE, |
1944 | 779 | loc, | 779 | loc, |
1946 | 780 | err::XPTY0004); | 780 | true); |
1947 | 781 | switch(subtype->type_kind()) | 781 | switch(subtype->type_kind()) |
1948 | 782 | { | 782 | { |
1949 | 783 | case XQType::ATOMIC_TYPE_KIND: | 783 | case XQType::ATOMIC_TYPE_KIND: |
1950 | @@ -866,7 +866,7 @@ | |||
1951 | 866 | xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), | 866 | xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), |
1952 | 867 | TypeConstants::QUANT_ONE, | 867 | TypeConstants::QUANT_ONE, |
1953 | 868 | loc, | 868 | loc, |
1955 | 869 | err::XPTY0004); | 869 | true); |
1956 | 870 | switch (subtype->type_kind()) | 870 | switch (subtype->type_kind()) |
1957 | 871 | { | 871 | { |
1958 | 872 | case XQType::ATOMIC_TYPE_KIND: | 872 | case XQType::ATOMIC_TYPE_KIND: |
1959 | @@ -911,7 +911,7 @@ | |||
1960 | 911 | xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), | 911 | xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), |
1961 | 912 | TypeConstants::QUANT_ONE, | 912 | TypeConstants::QUANT_ONE, |
1962 | 913 | loc, | 913 | loc, |
1964 | 914 | err::XPTY0004); | 914 | true); |
1965 | 915 | const UserDefinedXQType& udSuperType = | 915 | const UserDefinedXQType& udSuperType = |
1966 | 916 | static_cast<const UserDefinedXQType&>(supertype); | 916 | static_cast<const UserDefinedXQType&>(supertype); |
1967 | 917 | 917 | ||
1968 | 918 | 918 | ||
1969 | === modified file 'test/rbkt/Queries/zorba/modules/mainModule16.xq' | |||
1970 | --- test/rbkt/Queries/zorba/modules/mainModule16.xq 2012-09-19 21:16:15 +0000 | |||
1971 | +++ test/rbkt/Queries/zorba/modules/mainModule16.xq 2013-01-08 11:10:56 +0000 | |||
1972 | @@ -5,6 +5,8 @@ | |||
1973 | 5 | (: Purpose: Error XQST0036 :) | 5 | (: Purpose: Error XQST0036 :) |
1974 | 6 | (:*******************************************************:) | 6 | (:*******************************************************:) |
1975 | 7 | 7 | ||
1976 | 8 | xquery version "1.0"; | ||
1977 | 9 | |||
1978 | 8 | import module namespace math = "http://example.org/math-functions" at | 10 | import module namespace math = "http://example.org/math-functions" at |
1979 | 9 | "libraryModule12.xqlib"; | 11 | "libraryModule12.xqlib"; |
1980 | 10 | 12 |
Attempt to merge into lp:zorba failed due to conflicts:
text conflict in ChangeLog