zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #15904
[Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
Paul J. Lucas has proposed merging lp:~zorba-coders/zorba/bug-1044260 into lp:zorba.
Requested reviews:
Paul J. Lucas (paul-lucas)
Matthias Brantner (matthias-brantner)
Markos Zaharioudakis (markos-za)
Related bugs:
Bug #1044245 in Zorba: "Assertion failed: (result.first != result.second)"
https://bugs.launchpad.net/zorba/+bug/1044245
Bug #1044260 in Zorba: "Need way to test code for undefined diagnostic keys"
https://bugs.launchpad.net/zorba/+bug/1044260
Bug #1052283 in Zorba: "XUDY0021_AppliedAt used without definition"
https://bugs.launchpad.net/zorba/+bug/1052283
Bug #1052476 in Zorba: "JNUP0019 misused"
https://bugs.launchpad.net/zorba/+bug/1052476
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1044260/+merge/134779
ZED keys are now compile-time checked for existence.
Added error codes specified by Matthias.
--
https://code.launchpad.net/~zorba-coders/zorba/bug-1044260/+merge/134779
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/internal/diagnostic.h'
--- include/zorba/internal/diagnostic.h 2012-09-19 21:16:15 +0000
+++ include/zorba/internal/diagnostic.h 2012-11-17 18:51:21 +0000
@@ -70,15 +70,16 @@
/**
* Constructs a %location.
*
- * @param file The name of the file where the error occurred.
- * @param line The line number of the file where the expression that raises
- * the error begins.
+ * @param file The name of the file where the expression causing the error
+ * occurred.
+ * @param line The line number of the file where the expression causing the
+ * error begins.
* @param column The column number, if any, of the file where the expression
- * that raises the error begins.
+ * causing the error begins.
* @param line_end The end line number, if any, of the file where the
* expression causing the error ends.
* @param column_end The end column number, if any, of the file where the
- * xpression causing the error ends.
+ * expression causing the error ends.
*/
location( char const *file, line_type line, column_type column = 0,
line_type line_end = 0, column_type column_end = 0 ) :
=== modified file 'include/zorba/pregenerated/diagnostic_list.h'
--- include/zorba/pregenerated/diagnostic_list.h 2012-11-08 05:38:30 +0000
+++ include/zorba/pregenerated/diagnostic_list.h 2012-11-17 18:51:21 +0000
@@ -847,6 +847,8 @@
extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0012;
+extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0013;
+
extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0014;
extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0022;
=== modified file 'modules/org/jsoniq/www/pregenerated/errors.xq'
--- modules/org/jsoniq/www/pregenerated/errors.xq 2012-10-08 12:09:36 +0000
+++ modules/org/jsoniq/www/pregenerated/errors.xq 2012-11-17 18:51:21 +0000
@@ -100,6 +100,14 @@
declare variable $jerr:JNSE0012 as xs:QName := fn:QName($jerr:NS, "jerr:JNSE0012");
(:~
+ :It is a dynamic error to serialize an atomic value not
+ : supported by JSON or a node with the JSON output method and with
+ : the jsoniq-serialization-extensions serialization parameter
+ : set to false.
+:)
+declare variable $jerr:JNSE0013 as xs:QName := fn:QName($jerr:NS, "jerr:JNSE0013");
+
+(:~
:It is a dynamic error to serialize a function or a node with the
: JSON output method.
:)
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp 2012-11-08 05:38:30 +0000
+++ src/compiler/translator/translator.cpp 2012-11-17 18:51:21 +0000
@@ -6328,7 +6328,7 @@
if (v.has_allowing_empty())
{
if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0)
- RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_OuterForClause11)));
+ RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_OuterForClause30)));
theFlworClausesStack.push_back(NULL);
}
@@ -6547,7 +6547,7 @@
TRACE_VISIT();
if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0)
- RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_WindowClause11)));
+ RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_WindowClause30)));
return no_state;
}
@@ -7257,7 +7257,7 @@
TRACE_VISIT ();
if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0)
- RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_CountClause11)));
+ RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_CountClause30)));
return no_state;
}
@@ -7321,7 +7321,7 @@
if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0)
{
- RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_SwitchExpr11)));
+ RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_SwitchExpr30)));
}
v.get_switch_expr()->accept(*this);
@@ -7731,7 +7731,7 @@
if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0)
{
- RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_TryCatchExpr11)));
+ RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_TryCatchExpr30)));
}
theTryStack.push_back(&v);
=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp 2012-11-12 17:12:41 +0000
+++ src/context/static_context.cpp 2012-11-17 18:51:21 +0000
@@ -284,7 +284,7 @@
if (!module)
{
throw ZORBA_EXCEPTION(zerr::ZCSE0013_UNABLE_TO_LOAD_QUERY,
- ERROR_PARAMS(ZED(NoExternalModuleFromDLL), lURI));
+ ERROR_PARAMS(ZED(NoExternalModuleFromDLL_2), lURI));
}
}
else
=== modified file 'src/diagnostics/CMakeLists.txt'
--- src/diagnostics/CMakeLists.txt 2012-09-19 21:16:15 +0000
+++ src/diagnostics/CMakeLists.txt 2012-11-17 18:51:21 +0000
@@ -25,6 +25,7 @@
xquery_stack_trace.cpp
user_error.cpp
user_exception.cpp
+ dict_zed_keys.h
)
ZORBA_DIAGNOSTIC_GENERATOR(
@@ -32,21 +33,24 @@
"input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml"
"diagnostic_en.xml"
""
- "${CMAKE_BINARY_DIR}/include/zorba/diagnostic_list.h")
+ "${CMAKE_BINARY_DIR}/include/zorba/diagnostic_list.h"
+)
ZORBA_DIAGNOSTIC_GENERATOR(
"${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_list_cpp.xq"
"input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml"
"diagnostic_en.xml"
"${CMAKE_BINARY_DIR}/include/zorba/diagnostic_list.h"
- "${CMAKE_BINARY_DIR}/src/diagnostics/diagnostic_list.cpp")
+ "${CMAKE_BINARY_DIR}/src/diagnostics/diagnostic_list.cpp"
+)
ZORBA_DIAGNOSTIC_GENERATOR(
"${CMAKE_SOURCE_DIR}/src/diagnostics/dict_XX_cpp.xq"
"input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml"
"diagnostic_en.xml"
""
- "${CMAKE_BINARY_DIR}/src/diagnostics/dict_en.cpp")
+ "${CMAKE_BINARY_DIR}/src/diagnostics/dict_en.cpp"
+)
ZORBA_DIAGNOSTIC_GENERATOR(
"${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_list_xq.xq"
@@ -56,6 +60,14 @@
"${CMAKE_BINARY_DIR}/modules/w3c/xqt-errors.xq"
)
+ZORBA_DIAGNOSTIC_GENERATOR(
+ "${CMAKE_SOURCE_DIR}/src/diagnostics/dict_zed_keys_h.xq"
+ "input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml"
+ "diagnostic_en.xml"
+ ""
+ "${CMAKE_BINARY_DIR}/src/diagnostics/dict_zed_keys.h"
+)
+
IF(ZORBA_WITH_JSON)
ZORBA_DIAGNOSTIC_GENERATOR(
"${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_list_xq.xq"
@@ -79,8 +91,7 @@
"input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml;ns:=zwarn"
"diagnostic_en.xml"
""
- "${CMAKE_BINARY_DIR}/modules/com/zorba-xquery/www/modules/warnings.xq"
-)
+ "${CMAKE_BINARY_DIR}/modules/com/zorba-xquery/www/modules/warnings.xq")
SET(DIAG_MODULES
${CMAKE_BINARY_DIR}/modules/com/zorba-xquery/www/modules/warnings.xq
=== modified file 'src/diagnostics/diagnostic.h'
--- src/diagnostics/diagnostic.h 2012-09-19 21:16:15 +0000
+++ src/diagnostics/diagnostic.h 2012-11-17 18:51:21 +0000
@@ -19,6 +19,7 @@
#define ZORBA_DIAGNOSTIC_H
#include <zorba/diagnostic.h>
+#include <zorba/xquery_exception.h>
#include "compiler/parser/query_loc.h"
#include "store/api/item.h"
@@ -71,16 +72,41 @@
/**
* Makes a location.
*
- * @param file The name of the file where the error occurred.
- * @param line The line number of the file where the error occurred.
- * @param column The column number, if any, of the file where the error
+ * @param file The name of the file where the expression causing the error
* occurred.
+ * @param line The line number of the file where the expression causing the
+ * error begins.
+ * @param column The column number, if any, of the file where the expression
+ * causing the error begins.
+ * @param line_end The end line number, if any, of the file where the
+ * expression causing the error ends.
+ * @param column_end The end column number, if any, of the file where the
+ * expression causing the error ends.
* @return Returns a new location.
*/
inline internal::diagnostic::location
make_location( char const *file, internal::diagnostic::location::line_type line,
- internal::diagnostic::location::column_type column = 0 ) {
- return internal::diagnostic::location( file, line, column );
+ internal::diagnostic::location::column_type column = 0,
+ internal::diagnostic::location::line_type line_end = 0,
+ internal::diagnostic::location::column_type column_end = 0 ) {
+ return internal::diagnostic::location(
+ file, line, column, line_end, column_end
+ );
+}
+
+/**
+ * Makes a location.
+ *
+ * @param e The XQueryException to copy the location from.
+ * @return Returns a new location.
+ */
+inline internal::diagnostic::location
+make_location( XQueryException const &e ) {
+ return internal::diagnostic::location(
+ e.source_uri(),
+ e.source_line(), e.source_column(),
+ e.source_line_end(), e.source_column_end()
+ );
}
/**
=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml 2012-11-08 05:38:30 +0000
+++ src/diagnostics/diagnostic_en.xml 2012-11-17 18:51:21 +0000
@@ -14,6 +14,45 @@
! limitations under the License.
-->
+<!--
+ ! Please use the following convention for sub-message keys.
+ !
+ ! If a sub-message key has at least one $n number in it (where 'n' is [1-9]),
+ ! append an underscore ('_') followed by all the number(s) used in the value.
+ ! If the last $n is optional, append a lowercase 'o'.
+ !
+ ! For example, given this "throw" in C++ code:
+ !
+ ! throw XQUERY_EXCEPTION(
+ ! err::XPTY0004,
+ ! ERROR_PARAMS(
+ ! ZED( BadType_23o ), *domainType,
+ ! ZED( NoTreatAs_4 ), *declaredType
+ ! ),
+ ! ERROR_LOC( get_loc() )
+ ! );
+ !
+ ! The "bad type" and "no treat as" keys are defined as:
+ !
+ ! <entry key="BadType_23o">
+ ! <value>"$2": invalid type${: 3}</value>
+ ! </entry>
+ !
+ ! <entry key="NoTreatAs_4">
+ ! <value>can not treat as "$4"</value>
+ ! </entry>
+ !
+ ! In the "throw" above, you can tell just by looking at it that all the
+ ! required parameters are given and that each has the correct number/position.
+ !
+ ! ERROR_PARAMS(
+ ! ZED( BadType_23o ), // #1
+ ! *domainType, // #2
+ ! ZED( NoTreatAs_4 ), // #3
+ ! *declaredType // #4
+ ! ),
+ -->
+
<diagnostic-list lang="en">
<namespace prefix="err">
@@ -47,27 +86,27 @@
<value>"$2": XQuery version must be at least 3.0</value>
</entry>
- <entry key="OuterForClause11">
+ <entry key="OuterForClause30">
<value>"outer-for" clause only available in XQuery 3.0 or later</value>
</entry>
- <entry key="WindowClause11">
+ <entry key="WindowClause30">
<value>"window" clause only available in XQuery 3.0 or later</value>
</entry>
- <entry key="CountClause11">
+ <entry key="CountClause30">
<value>"count" clause only available in XQuery 3.0 or later</value>
</entry>
- <entry key="SwitchExpr11">
+ <entry key="SwitchExpr30">
<value>"switch" expressions only available in XQuery 3.0 or later</value>
</entry>
- <entry key="TryCatchExpr11">
+ <entry key="TryCatchExpr30">
<value>"try/catch" expressions only available in XQuery 3.0 or later</value>
</entry>
- <entry key="Anotations">
+ <entry key="Annotations">
<value>function and variable annotations only available in XQuery 3.0 or later</value>
</entry>
@@ -156,32 +195,32 @@
<value>$1</value>
- <entry key="FuncReturn">
+ <entry key="NoReturnTypePromote_234">
<value>$2 can not be promoted to return type $3 of function $4()</value>
</entry>
- <entry key="FuncParam">
+ <entry key="NoParamTypePromote_234">
<value>$2 can not be promoted to parameter type $3 of function $4()</value>
</entry>
- <entry key="TypePromotion">
+ <entry key="NoTypePromote_23">
<value>$2 can not be promoted to type $3</value>
</entry>
- <entry key="NoMultiSeqTypePromotion">
+ <entry key="NoMultiSeqTypePromotion_2">
<value>sequence of more than one item can not be promoted to type $2</value>
</entry>
- <entry key="TypeMatch">
+ <entry key="NoTreatAs_23">
<value>$2 can not be treated as type $3</value>
</entry>
<entry key="FormatNumber_2">
- <value>the first parameter to the format-number() function is of type $2, which is not allowed</value>
+ <value>first parameter to format-number() function is type $2 that is not allowed</value>
</entry>
<entry key="JSONIQ_SELECTOR">
- <value>Cannot atomize and/or cast value of type $2 to a string.</value>
+ <value>can not atomize and/or cast value of type $2 to string</value>
</entry>
<entry key="MultiValuedGroupingKey">
@@ -1436,7 +1475,15 @@
[XQuery 1.0 and XPath 2.0 Data Model]. In this case, none of the updates
in the query are made effective.
</comment>
- <value>updates violate constraint</value>
+ <value>$1${ 2}</value>
+
+ <entry key="AttributeName">
+ <value>"$3": attribute with the same name already exists</value>
+ </entry>
+
+ <entry key="AppliedAt">
+ <value>(applied at $3)</value>
+ </entry>
</diagnostic>
<diagnostic code="XUTY0022">
@@ -1988,11 +2035,11 @@
</diagnostic>
<diagnostic code="ZAPI0080" name="CANNOT_RETRIEVE_NODE_REFERENCE">
- <value>can not retrieve node-reference for a node that is not in a collection.</value>
+ <value>can not retrieve node-reference for a node that is not in a collection</value>
</diagnostic>
<diagnostic code="ZAPI0090" name="CANNOT_VALIDATE_NON_ROOT">
- <value>a non root element cannot be validated in place.</value>
+ <value>non root element cannot be validated in place</value>
</diagnostic>
<!--////////// Zorba Class Serialization Errors ////////////////////////-->
@@ -2488,7 +2535,7 @@
</diagnostic>
<diagnostic code="ZSTR0066" name="REFERENCED_NODE_NOT_IN_COLLECTION">
- <value>$1: does not reference a node in collection $2.</value>
+ <value>$1: does not reference a node in collection $2</value>
</diagnostic>
<!--////////// XQuery Scripting ////////////////////////////////////////-->
@@ -2561,6 +2608,7 @@
<diagnostic code="ZJPE0009" name="ILLEGAL_EMPTY_STRING">
<value>illegal empty string</value>
</diagnostic>
+
<diagnostic code="ZJPE0010" name="JSONML_ARRAY_REQUIRES_BRACKET">
<value>JsonML (array form) must start with '['</value>
</diagnostic>
@@ -2607,17 +2655,17 @@
<diagnostic code="JNTY0002" if="defined(ZORBA_WITH_JSON)">
<comment>It is a type error if the right-hand-side expression of a pair constructor does not return exactly one item.</comment>
- <value>Pair value returns no, or more than one, item.</value>
+ <value>pair value returns no, or more than one, item</value>
</diagnostic>
<diagnostic code="JNDY0003" if="defined(ZORBA_WITH_JSON)">
<comment>It is a dynamic error if two pairs in an object constructor or in a simple object union have the same name.</comment>
- <value>"$1": pair with the same name already exists in object.</value>
+ <value>"$1": pair with the same name already exists in object</value>
</diagnostic>
<diagnostic code="JNTY0004" if="defined(ZORBA_WITH_JSON)">
<comment>It is a type error to call fn:data on a sequence containing an array or an object.</comment>
- <value>Cannot atomize an $1 item. An $1 has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item).</value>
+ <value>can not atomize an $1 item: an $1 has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item)</value>
</diagnostic>
<diagnostic code="JNUP0005" if="defined(ZORBA_WITH_JSON)">
@@ -2630,14 +2678,14 @@
<diagnostic code="JNUP0006" if="defined(ZORBA_WITH_JSON)">
<comment>It is a dynamic error if upd:applyUpdates causes an object to contain two pairs with the same name.</comment>
- <value>"$1": pair to insert already exists in object.</value>
+ <value>"$1": pair to insert already exists in object</value>
</diagnostic>
<diagnostic code="JNUP0007" if="defined(ZORBA_WITH_JSON)">
<comment>It is a type error if, in an updating expression, an array selector cannot be cast to xs:integer or if an object selector cannot be cast to xs:string.</comment>
- <value>$1 - wrong type for object/array selector in update expression.</value>
+ <value>"$1": wrong type for object/array selector in update expression</value>
<entry key="Object">
<value>"$2": can not be promoted to type xs:string</value>
@@ -2663,7 +2711,7 @@
<value>$1</value>
<entry key="Object">
- <value>"$2": target of a renaming expression or of a non-position-inserting expression is not an object.</value>
+ <value>"$2": target of a renaming expression or of a non-position-inserting expression is not an object</value>
</entry>
<entry key="Array">
@@ -2671,7 +2719,7 @@
</entry>
<entry key="ObjectArray">
- <value>"$2": target of a deleting or replacing expression is not a JSON item.</value>
+ <value>"$2": target of a deleting or replacing expression is not a JSON item</value>
</entry>
</diagnostic>
@@ -2700,6 +2748,15 @@
<value>can not serialize multiple top-level items as JSON</value>
</diagnostic>
+ <diagnostic code="JNSE0013" if="defined(ZORBA_WITH_JSON)">
+ <comment>It is a dynamic error to serialize an atomic value not
+ supported by JSON or a node with the JSON output method and with
+ the jsoniq-serialization-extensions serialization parameter
+ set to false.</comment>
+
+ <value>can not serialize value as JSON: $1</value>
+ </diagnostic>
+
<diagnostic code="JNSE0014" if="defined(ZORBA_WITH_JSON)">
<comment>It is a dynamic error to serialize a function or a node with the
JSON output method.</comment>
@@ -2710,7 +2767,7 @@
<comment>It is a dynamic error to serialize a sequence that does
not exist of exactly one document node with XML, HTML, XHTML, Text.
</comment>
- <value>$1: invalid serialization method for item type ($2)</value>
+ <value>"$1": invalid serialization method for item type ($2)</value>
</diagnostic>
<diagnostic code="JNUP0016" if="defined(ZORBA_WITH_JSON)">
@@ -2719,29 +2776,29 @@
<value>$1</value>
<entry key="Object">
- <value>"$2": selector cannot be resolved against supplied object.</value>
+ <value>"$2": selector cannot be resolved against supplied object</value>
</entry>
<entry key="Array">
- <value>"$2": selector cannot be resolved against supplied array.</value>
+ <value>"$2": selector cannot be resolved against supplied array</value>
</entry>
</diagnostic>
<diagnostic code="JNUP0017" if="defined(ZORBA_WITH_JSON)">
<comment> It is a dynamic error if the value in a replace expression is not exactly a single item.</comment>
- <value>Cannot replace with less or more than an item.</value>
+ <value>can not replace with less or more than an item</value>
</diagnostic>
<diagnostic code="JNTY0018" if="defined(ZORBA_WITH_JSON)">
<comment>It is a dynamic error if there is not exactly one supplied parameter for an object or array selector.</comment>
- <value>Object or array selection needs exactly one parameter.</value>
+ <value>object or array selection needs exactly one parameter</value>
</diagnostic>
<diagnostic code="JNUP0019" if="defined(ZORBA_WITH_JSON)">
<comment>It is a dynamic error if the content expression, in an object insert expression, does not evaluate to a sequence of objects.</comment>
- <value>The content of an insert expression must evaluate to a sequence of objects.</value>
+ <value>"$1": invalid type (content of insert expression must evaluate to a sequence of objects)</value>
</diagnostic>
<diagnostic code="JNTY0023" if="defined(ZORBA_WITH_JSON)">
@@ -2787,7 +2844,7 @@
</diagnostic>
<diagnostic code="ZWST0004" name="AMBIGUOUS_SEQUENTIAL_FLWOR">
- <value>Sequential FLWOR expr may not have the semantics you expect</value>
+ <value>sequential FLWOR expr may not have the semantics you expect</value>
</diagnostic>
<diagnostic code="ZWST0005" name="CACHING_NOT_POSSIBLE">
@@ -3003,6 +3060,10 @@
<value>collection iterator not open</value>
</entry>
+ <entry key="DefaultCollection">
+ <value>default collection</value>
+ </entry>
+
<entry key="DefaultCollation">
<value>default collation</value>
</entry>
@@ -3107,11 +3168,11 @@
<value>full-text was not enabled in this build</value>
</entry>
- <entry key="FunctionFailedErrorCodeMessage_123">
+ <entry key="FunctionFailedErrorCodeMessage_234">
<value>$2 failed (error $3): $4</value>
</entry>
- <entry key="FunctionFailed_12o">
+ <entry key="FunctionFailed_23o">
<value>$2 failed${: 3}</value>
</entry>
@@ -3271,6 +3332,14 @@
<value>document, collection, or module resolver required but no SerializationCallback given</value>
</entry>
+ <entry key="NoExternalFunction_2">
+ <value>"$2": external function not found</value>
+ </entry>
+
+ <entry key="NoExternalModuleFromDLL_2">
+ <value>required external module "$2" not found</value>
+ </entry>
+
<entry key="NoSerializationCallbackForModule">
<value>no SerializationCallback for required external module "$2"</value>
</entry>
=== modified file 'src/diagnostics/dict.h'
--- src/diagnostics/dict.h 2012-09-19 21:16:15 +0000
+++ src/diagnostics/dict.h 2012-11-17 18:51:21 +0000
@@ -17,6 +17,8 @@
#ifndef ZORBA_DIAGNOSTIC_DICT_H
#define ZORBA_DIAGNOSTIC_DICT_H
+#include "diagnostics/dict_zed_keys.h"
+
namespace zorba {
namespace diagnostic {
namespace dict {
@@ -40,7 +42,7 @@
* \endcode
* \hideinitializer
*/
-#define ZED(DICT_KEY) ZED_PREFIX #DICT_KEY
+#define ZED(DICT_KEY) ZED_##DICT_KEY
/**
* Looks up the given key in the language dictionary.
=== added file 'src/diagnostics/dict_zed_keys_h.xq'
--- src/diagnostics/dict_zed_keys_h.xq 1970-01-01 00:00:00 +0000
+++ src/diagnostics/dict_zed_keys_h.xq 2012-11-17 18:51:21 +0000
@@ -0,0 +1,55 @@
+(:
+ : Copyright 2006-2009 The FLWOR Foundation.
+ :
+ : Licensed under the Apache License, Version 2.0 (the "License");
+ : you may not use this file except in compliance with the License.
+ : You may obtain a copy of the License at
+ :
+ : http://www.apache.org/licenses/LICENSE-2.0
+ :
+ : Unless required by applicable law or agreed to in writing, software
+ : distributed under the License is distributed on an "AS IS" BASIS,
+ : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ : See the License for the specific language governing permissions and
+ : limitations under the License.
+:)
+
+import module namespace util = "http://www.zorba-xquery.com/diagnostic/util" at "diagnostic_util.xq";
+
+declare function local:make-zed-defines( $doc ) as xs:string*
+{
+ for $entry in ( $doc//entry )
+ let $key := $entry/@key
+ return
+ if ( contains( $key, ' ' ) )
+ then ()
+ else
+ let $full_key :=
+ if ( $entry/parent::diagnostic )
+ then concat( $entry/parent::diagnostic/@code, "_", $key )
+ else $key
+ return concat( "#define ZED_", $full_key, ' "~', $full_key, '"' )
+};
+
+declare variable $input external;
+
+string-join(
+ ( util:copyright(),
+ '#ifndef ZORBA_DIAGNOSTICS_ZED_KEYS',
+ '#define ZORBA_DIAGNOSTICS_ZED_KEYS',
+ '',
+ local:make-zed-defines( $input ),
+ '',
+ '#endif /* ZORBA_DIAGNOSTICS_ZED_KEYS */',
+ '/*',
+ ' * Local variables:',
+ ' * mode: c++',
+ ' * End:',
+ ' */',
+ '/* vim:set et sw=2 ts=2: */'
+ ),
+ $util:newline
+),
+$util:newline
+
+(: vim:set syntax=xquery et sw=2 ts=2: :)
=== modified file 'src/diagnostics/pregenerated/diagnostic_list.cpp'
--- src/diagnostics/pregenerated/diagnostic_list.cpp 2012-11-08 05:38:30 +0000
+++ src/diagnostics/pregenerated/diagnostic_list.cpp 2012-11-17 18:51:21 +0000
@@ -1246,6 +1246,9 @@
JSONiqErrorCode JNSE0012( "JNSE0012" );
+JSONiqErrorCode JNSE0013( "JNSE0013" );
+
+
JSONiqErrorCode JNSE0014( "JNSE0014" );
=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp 2012-11-08 05:38:30 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp 2012-11-17 18:51:21 +0000
@@ -98,7 +98,7 @@
{ "FTST0019", "\"$1\": match option specified more than once" },
#endif
#if defined(ZORBA_WITH_JSON)
- { "JNDY0003", "\"$1\": pair with the same name already exists in object." },
+ { "JNDY0003", "\"$1\": pair with the same name already exists in object" },
#endif
#if defined(ZORBA_WITH_JSON)
{ "JNDY0021", "$1" },
@@ -107,22 +107,25 @@
{ "JNSE0012", "can not serialize multiple top-level items as JSON" },
#endif
#if defined(ZORBA_WITH_JSON)
+ { "JNSE0013", "can not serialize value as JSON: $1" },
+#endif
+#if defined(ZORBA_WITH_JSON)
{ "JNSE0014", "can not serialize a node or function item as JSON" },
#endif
#if defined(ZORBA_WITH_JSON)
- { "JNSE0022", "$1: invalid serialization method for item type ($2)" },
-#endif
-#if defined(ZORBA_WITH_JSON)
- { "JNTY0002", "Pair value returns no, or more than one, item." },
-#endif
-#if defined(ZORBA_WITH_JSON)
- { "JNTY0004", "Cannot atomize an $1 item. An $1 has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item)." },
+ { "JNSE0022", "\"$1\": invalid serialization method for item type ($2)" },
+#endif
+#if defined(ZORBA_WITH_JSON)
+ { "JNTY0002", "pair value returns no, or more than one, item" },
+#endif
+#if defined(ZORBA_WITH_JSON)
+ { "JNTY0004", "can not atomize an $1 item: an $1 has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item)" },
#endif
#if defined(ZORBA_WITH_JSON)
{ "JNTY0011", "JSON item cannot appear in content sequence of node constructor or updating expression" },
#endif
#if defined(ZORBA_WITH_JSON)
- { "JNTY0018", "Object or array selection needs exactly one parameter." },
+ { "JNTY0018", "object or array selection needs exactly one parameter" },
#endif
#if defined(ZORBA_WITH_JSON)
{ "JNTY0020", "$1: invalid option type for option $2 (expected $3)" },
@@ -137,10 +140,10 @@
{ "JNUP0005", "\"$1\": duplicate pair to insert" },
#endif
#if defined(ZORBA_WITH_JSON)
- { "JNUP0006", "\"$1\": pair to insert already exists in object." },
+ { "JNUP0006", "\"$1\": pair to insert already exists in object" },
#endif
#if defined(ZORBA_WITH_JSON)
- { "JNUP0007", "$1 - wrong type for object/array selector in update expression." },
+ { "JNUP0007", "\"$1\": wrong type for object/array selector in update expression" },
#endif
#if defined(ZORBA_WITH_JSON)
{ "JNUP0008", "$1" },
@@ -155,10 +158,10 @@
{ "JNUP0016", "$1" },
#endif
#if defined(ZORBA_WITH_JSON)
- { "JNUP0017", "Cannot replace with less or more than an item." },
+ { "JNUP0017", "can not replace with less or more than an item" },
#endif
#if defined(ZORBA_WITH_JSON)
- { "JNUP0019", "The content of an insert expression must evaluate to a sequence of objects." },
+ { "JNUP0019", "\"$1\": invalid type (content of insert expression must evaluate to a sequence of objects)" },
#endif
{ "SENR0001", "\"$1\": can not serialize $2" },
{ "SEPM0004", "doctype-system parameter, or standalone parameter with a value other than \"omit\", specified" },
@@ -270,7 +273,7 @@
{ "XUDY0017", "node is target of multiple \"replace value of\" expressions in same query" },
{ "XUDY0018", "\"$1\": function declared external, non-updating returns non-empty pending update list" },
{ "XUDY0019", "\"$1\": function declated external, updating returns non-empty data model instance" },
- { "XUDY0021", "updates violate constraint" },
+ { "XUDY0021", "$1${ 2}" },
{ "XUDY0023", "\"$1\": namespace binding conflicts with $2=$3" },
{ "XUDY0024", "\"$1\": namespace binding conflicts with $2=$3" },
{ "XUDY0027", "target expression is empty sequence" },
@@ -320,8 +323,8 @@
{ "ZAPI0043", "cannot serialize JSON item using current output method" },
{ "ZAPI0045", "cannot serialize sequence containing both JSON and XML items" },
{ "ZAPI0070", "\"$1\": invalid serialization method for SAX" },
- { "ZAPI0080", "can not retrieve node-reference for a node that is not in a collection." },
- { "ZAPI0090", "a non root element cannot be validated in place." },
+ { "ZAPI0080", "can not retrieve node-reference for a node that is not in a collection" },
+ { "ZAPI0090", "non root element cannot be validated in place" },
{ "ZCSE0001", "\"$1\": nonexistent input field" },
{ "ZCSE0002", "\"$1\": incompatible input field${: type=2}${, class=3}" },
{ "ZCSE0003", "\"$1\": unrecognized class field" },
@@ -455,10 +458,10 @@
{ "ZSTR0055", "streamable string has already been consumed" },
{ "ZSTR0060", "out of range: $1" },
{ "ZSTR0065", "Zorba did not close properly, objects may still in memory.\n$1 referenced URI(s) remain in the string pool.\nFor help avoiding this message please refer to http://www.zorba-xquery.com/html/documentation in section General Architecture -> Memory Leaks." },
- { "ZSTR0066", "$1: does not reference a node in collection $2." },
+ { "ZSTR0066", "$1: does not reference a node in collection $2" },
{ "ZWST0002", "\"$1\": unknown or unsupported annotation" },
{ "ZWST0003", "\"$1\": function declared sequential, but has non-sequential body" },
- { "ZWST0004", "Sequential FLWOR expr may not have the semantics you expect" },
+ { "ZWST0004", "sequential FLWOR expr may not have the semantics you expect" },
{ "ZWST0005", "\"$1\": function caching not possible; $2" },
{ "ZWST0006", "\"$1\": function caching might not give the intended result because the function is declared as $2" },
{ "ZXQD0001", "\"$1\": prefix not declared when calling function \"$2\" from $3" },
@@ -560,6 +563,7 @@
{ "~ClosingBraceWithoutOpen", "'}' encountered without '{' first" },
{ "~CollectionIteratorNotOpen", "collection iterator not open" },
{ "~DefaultCollation", "default collation" },
+ { "~DefaultCollection", "default collection" },
{ "~DivisionNoINF", "division can not have +-INF dividend" },
{ "~DivisionNoNaN", "division can not involve NaN" },
{ "~DocNodeMultipleElements", "document node has more than one element" },
@@ -596,8 +600,8 @@
{ "~FormatNumberIntegerPart", ": the integer part of a sub-picture must not contain a member of the decimal-digit-family that is followed by an optional-digit-sign" },
{ "~FormatNumberPercentPermille", ": a sub-picture must not contain more than one percent-sign or per-mille-sign, and it must not contain one of each" },
{ "~FullTextNotEnabled", "full-text was not enabled in this build" },
- { "~FunctionFailedErrorCodeMessage_123", "$2 failed (error $3): $4" },
- { "~FunctionFailed_12o", "$2 failed${: 3}" },
+ { "~FunctionFailedErrorCodeMessage_234", "$2 failed (error $3): $4" },
+ { "~FunctionFailed_23o", "$2 failed${: 3}" },
{ "~FunctionUndeclared_3", "function with arity $3 not declared" },
{ "~GoodValuesAreUTF8", "valid values are: UTF-8, UTF-16" },
{ "~GoodValuesAreXMLEtc", "valid values are: xml, html, xhtml, text, binary, json, jsoniq" },
@@ -610,10 +614,10 @@
{ "~JNUP0007_Object", "\"$2\": can not be promoted to type xs:string" },
{ "~JNUP0007_ObjectArray", "\"$2\": can not be promoted to type xs:anyAtomicType" },
{ "~JNUP0008_Array", "\"$2\": target of an appending expression or of a position-inserting expression is not an array" },
- { "~JNUP0008_Object", "\"$2\": target of a renaming expression or of a non-position-inserting expression is not an object." },
- { "~JNUP0008_ObjectArray", "\"$2\": target of a deleting or replacing expression is not a JSON item." },
- { "~JNUP0016_Array", "\"$2\": selector cannot be resolved against supplied array." },
- { "~JNUP0016_Object", "\"$2\": selector cannot be resolved against supplied object." },
+ { "~JNUP0008_Object", "\"$2\": target of a renaming expression or of a non-position-inserting expression is not an object" },
+ { "~JNUP0008_ObjectArray", "\"$2\": target of a deleting or replacing expression is not a JSON item" },
+ { "~JNUP0016_Array", "\"$2\": selector cannot be resolved against supplied array" },
+ { "~JNUP0016_Object", "\"$2\": selector cannot be resolved against supplied object" },
{ "~JSON parser error", "JSON parser error" },
{ "~JSON serialization error", "JSON serialization error" },
{ "~JSON_ILLEGAL_CHARACTER", "'$2': illegal JSON character${ at 3}" },
@@ -649,6 +653,8 @@
{ "~NoEmptyLocalname", "local-name can not be empty" },
{ "~NoEmptySeqAsBaseURI", "can't treat empty sequence as base URI" },
{ "~NoEmptySeqAsCollationParam", "empty-sequence not allowed as collation parameter" },
+ { "~NoExternalFunction_2", "\"$2\": external function not found" },
+ { "~NoExternalModuleFromDLL_2", "required external module \"$2\" not found" },
{ "~NoHashItemOfType_2", "can not hash item of type \"$2\"" },
{ "~NoInputData", "no input data" },
{ "~NoModuleURIResolver", "no module URI resolver could be retrieved using SerializationCallback" },
@@ -862,27 +868,29 @@
{ "~VariabledHasNoValue", "variable has no value" },
{ "~VariabledUndeclared", "undeclared variable" },
{ "~XMLSchema", "XML schema" },
- { "~XPST0003_Anotations", "function and variable annotations only available in XQuery 3.0 or later" },
- { "~XPST0003_CountClause11", "\"count\" clause only available in XQuery 3.0 or later" },
+ { "~XPST0003_Annotations", "function and variable annotations only available in XQuery 3.0 or later" },
+ { "~XPST0003_CountClause30", "\"count\" clause only available in XQuery 3.0 or later" },
{ "~XPST0003_ModuleDeclNotInMain", "module declaration must not be in main module" },
- { "~XPST0003_OuterForClause11", "\"outer-for\" clause only available in XQuery 3.0 or later" },
+ { "~XPST0003_OuterForClause30", "\"outer-for\" clause only available in XQuery 3.0 or later" },
{ "~XPST0003_PiTarget", "\"XML\" not allowed as target of a direct processing-instruction constructor" },
{ "~XPST0003_Scripting", "scripting feature not available" },
{ "~XPST0003_StartEndTagMismatch_23", "start tag \"$2\" does not match end tag \"$3\"" },
- { "~XPST0003_SwitchExpr11", "\"switch\" expressions only available in XQuery 3.0 or later" },
- { "~XPST0003_TryCatchExpr11", "\"try/catch\" expressions only available in XQuery 3.0 or later" },
- { "~XPST0003_WindowClause11", "\"window\" clause only available in XQuery 3.0 or later" },
+ { "~XPST0003_SwitchExpr30", "\"switch\" expressions only available in XQuery 3.0 or later" },
+ { "~XPST0003_TryCatchExpr30", "\"try/catch\" expressions only available in XQuery 3.0 or later" },
+ { "~XPST0003_WindowClause30", "\"window\" clause only available in XQuery 3.0 or later" },
{ "~XPST0003_XQueryVersionAtLeast30_2", "\"$2\": XQuery version must be at least 3.0" },
- { "~XPTY0004_FormatNumber_2", "the first parameter to the format-number() function is of type $2, which is not allowed" },
- { "~XPTY0004_FuncParam", "$2 can not be promoted to parameter type $3 of function $4()" },
- { "~XPTY0004_FuncReturn", "$2 can not be promoted to return type $3 of function $4()" },
- { "~XPTY0004_JSONIQ_SELECTOR", "Cannot atomize and/or cast value of type $2 to a string." },
+ { "~XPTY0004_FormatNumber_2", "first parameter to format-number() function is type $2 that is not allowed" },
+ { "~XPTY0004_JSONIQ_SELECTOR", "can not atomize and/or cast value of type $2 to string" },
{ "~XPTY0004_MultiValuedGroupingKey", "atomization of grouping variable produces more than one item" },
- { "~XPTY0004_NoMultiSeqTypePromotion", "sequence of more than one item can not be promoted to type $2" },
- { "~XPTY0004_TypeMatch", "$2 can not be treated as type $3" },
- { "~XPTY0004_TypePromotion", "$2 can not be promoted to type $3" },
+ { "~XPTY0004_NoMultiSeqTypePromotion_2", "sequence of more than one item can not be promoted to type $2" },
+ { "~XPTY0004_NoParamTypePromote_234", "$2 can not be promoted to parameter type $3 of function $4()" },
+ { "~XPTY0004_NoReturnTypePromote_234", "$2 can not be promoted to return type $3 of function $4()" },
+ { "~XPTY0004_NoTreatAs_23", "$2 can not be treated as type $3" },
+ { "~XPTY0004_NoTypePromote_23", "$2 can not be promoted to type $3" },
{ "~XQST0106_CONFLICTING", "conflicting" },
{ "~XQST0106_THE_SAME", "the same" },
+ { "~XUDY0021_AppliedAt", "(applied at $3)" },
+ { "~XUDY0021_AttributeName", "\"$3\": attribute with the same name already exists" },
{ "~XUST0001_CONCAT", "comma expression with updating and non-updating branches" },
{ "~XUST0001_Generic", "updating expression illegal here" },
{ "~XUST0001_IF", "conditional expression with updating and non-updating branch" },
=== added file 'src/diagnostics/pregenerated/dict_zed_keys.h'
--- src/diagnostics/pregenerated/dict_zed_keys.h 1970-01-01 00:00:00 +0000
+++ src/diagnostics/pregenerated/dict_zed_keys.h 2012-11-17 18:51:21 +0000
@@ -0,0 +1,338 @@
+/**
+ * Copyright 2006-2011 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /*
+ * THIS FILE IS GENERATED.
+ * PLEASE DO NOT EDIT.
+ */
+
+#ifndef ZORBA_DIAGNOSTICS_ZED_KEYS
+#define ZORBA_DIAGNOSTICS_ZED_KEYS
+
+#define ZED_XPST0003_StartEndTagMismatch_23 "~XPST0003_StartEndTagMismatch_23"
+#define ZED_XPST0003_ModuleDeclNotInMain "~XPST0003_ModuleDeclNotInMain"
+#define ZED_XPST0003_XQueryVersionAtLeast30_2 "~XPST0003_XQueryVersionAtLeast30_2"
+#define ZED_XPST0003_OuterForClause30 "~XPST0003_OuterForClause30"
+#define ZED_XPST0003_WindowClause30 "~XPST0003_WindowClause30"
+#define ZED_XPST0003_CountClause30 "~XPST0003_CountClause30"
+#define ZED_XPST0003_SwitchExpr30 "~XPST0003_SwitchExpr30"
+#define ZED_XPST0003_TryCatchExpr30 "~XPST0003_TryCatchExpr30"
+#define ZED_XPST0003_Annotations "~XPST0003_Annotations"
+#define ZED_XPST0003_Scripting "~XPST0003_Scripting"
+#define ZED_XPST0003_PiTarget "~XPST0003_PiTarget"
+#define ZED_XPTY0004_NoReturnTypePromote_234 "~XPTY0004_NoReturnTypePromote_234"
+#define ZED_XPTY0004_NoParamTypePromote_234 "~XPTY0004_NoParamTypePromote_234"
+#define ZED_XPTY0004_NoTypePromote_23 "~XPTY0004_NoTypePromote_23"
+#define ZED_XPTY0004_NoMultiSeqTypePromotion_2 "~XPTY0004_NoMultiSeqTypePromotion_2"
+#define ZED_XPTY0004_NoTreatAs_23 "~XPTY0004_NoTreatAs_23"
+#define ZED_XPTY0004_FormatNumber_2 "~XPTY0004_FormatNumber_2"
+#define ZED_XPTY0004_JSONIQ_SELECTOR "~XPTY0004_JSONIQ_SELECTOR"
+#define ZED_XPTY0004_MultiValuedGroupingKey "~XPTY0004_MultiValuedGroupingKey"
+#define ZED_XQST0106_THE_SAME "~XQST0106_THE_SAME"
+#define ZED_XQST0106_CONFLICTING "~XQST0106_CONFLICTING"
+#define ZED_FTST0009_BadStopWordsLang "~FTST0009_BadStopWordsLang"
+#define ZED_FTST0009_BadStemmerLang "~FTST0009_BadStemmerLang"
+#define ZED_FTST0009_BadThesaurusLang "~FTST0009_BadThesaurusLang"
+#define ZED_FTST0009_BadTokenizerLang "~FTST0009_BadTokenizerLang"
+#define ZED_XUST0001_CONCAT "~XUST0001_CONCAT"
+#define ZED_XUST0001_TRYCATCH "~XUST0001_TRYCATCH"
+#define ZED_XUST0001_Generic "~XUST0001_Generic"
+#define ZED_XUST0001_IF "~XUST0001_IF"
+#define ZED_XUST0001_UDF_2 "~XUST0001_UDF_2"
+#define ZED_XUDY0021_AttributeName "~XUDY0021_AttributeName"
+#define ZED_XUDY0021_AppliedAt "~XUDY0021_AppliedAt"
+#define ZED_ZXQP0004_TypeOps_is_in_scope_ForFunctionItemTypes "~ZXQP0004_TypeOps_is_in_scope_ForFunctionItemTypes"
+#define ZED_ZXQP0025_RESOURCE_NOT_FOUND "~ZXQP0025_RESOURCE_NOT_FOUND"
+#define ZED_ZXQD0004_NON_NEGATIVE "~ZXQD0004_NON_NEGATIVE"
+#define ZED_ZXQD0004_NOT_WITHIN_RANGE "~ZXQD0004_NOT_WITHIN_RANGE"
+#define ZED_ZDST0027_NO_KEY_TYPE_DECL "~ZDST0027_NO_KEY_TYPE_DECL"
+#define ZED_ZDST0027_NON_SPECIFIC_KEY_TYPE_DECL "~ZDST0027_NON_SPECIFIC_KEY_TYPE_DECL"
+#define ZED_ZDST0027_MULTI_VALUED_KEY_TYPE_DECL "~ZDST0027_MULTI_VALUED_KEY_TYPE_DECL"
+#define ZED_ZDST0027_NON_ATOMIC_KEY_TYPE "~ZDST0027_NON_ATOMIC_KEY_TYPE"
+#define ZED_ZDST0027_NON_ORDERED_KEY_TYPE "~ZDST0027_NON_ORDERED_KEY_TYPE"
+#define ZED_ZDST0060_unknown_namespace "~ZDST0060_unknown_namespace"
+#define ZED_ZDST0060_unknown_localname "~ZDST0060_unknown_localname"
+#define ZED_JNUP0007_Object "~JNUP0007_Object"
+#define ZED_JNUP0007_Array "~JNUP0007_Array"
+#define ZED_JNUP0007_ObjectArray "~JNUP0007_ObjectArray"
+#define ZED_JNUP0008_Object "~JNUP0008_Object"
+#define ZED_JNUP0008_Array "~JNUP0008_Array"
+#define ZED_JNUP0008_ObjectArray "~JNUP0008_ObjectArray"
+#define ZED_JNUP0016_Object "~JNUP0016_Object"
+#define ZED_JNUP0016_Array "~JNUP0016_Array"
+#define ZED_ZWST0005_RETURN_TYPE "~ZWST0005_RETURN_TYPE"
+#define ZED_ZWST0005_PARAM_TYPE "~ZWST0005_PARAM_TYPE"
+#define ZED_ZWST0005_UPDATING "~ZWST0005_UPDATING"
+#define ZED_ZWST0005_VARIADIC "~ZWST0005_VARIADIC"
+#define ZED_AllMatchesHasExcludes "~AllMatchesHasExcludes"
+#define ZED_AlreadySpecified "~AlreadySpecified"
+#define ZED_ArithOpNotDefinedBetween_23 "~ArithOpNotDefinedBetween_23"
+#define ZED_AtomizationHasMoreThanOneValue "~AtomizationHasMoreThanOneValue"
+#define ZED_AttributeName "~AttributeName"
+#define ZED_AttributeNode "~AttributeNode"
+#define ZED_BackRef0Illegal "~BackRef0Illegal"
+#define ZED_BackRefIllegalInCharClass "~BackRefIllegalInCharClass"
+#define ZED_BadAnyURI "~BadAnyURI"
+#define ZED_BadArgTypeForFn_2o34o "~BadArgTypeForFn_2o34o"
+#define ZED_BadCharAfter_34 "~BadCharAfter_34"
+#define ZED_BadCharInBraces_3 "~BadCharInBraces_3"
+#define ZED_BadDecDigit_3 "~BadDecDigit_3"
+#define ZED_BadFileURIAuthority_2 "~BadFileURIAuthority_2"
+#define ZED_BadHexDigit_3 "~BadHexDigit_3"
+#define ZED_BadHexSequence "~BadHexSequence"
+#define ZED_BadItem "~BadItem"
+#define ZED_BadIterator "~BadIterator"
+#define ZED_BadLibraryModule "~BadLibraryModule"
+#define ZED_BadRegexEscape_3 "~BadRegexEscape_3"
+#define ZED_BadPath "~BadPath"
+#define ZED_BadStreamState "~BadStreamState"
+#define ZED_BadTokenInBraces_3 "~BadTokenInBraces_3"
+#define ZED_BadTraceStream "~BadTraceStream"
+#define ZED_BadTypeFor_23 "~BadTypeFor_23"
+#define ZED_BadType_23o "~BadType_23o"
+#define ZED_BadURIScheme_3 "~BadURIScheme_3"
+#define ZED_BadURISyntaxForScheme_3 "~BadURISyntaxForScheme_3"
+#define ZED_BadUnicodeChar_3 "~BadUnicodeChar_3"
+#define ZED_BadWordNetPartOfSpeech_2 "~BadWordNetPartOfSpeech_2"
+#define ZED_BadWordNetPtr_2 "~BadWordNetPtr_2"
+#define ZED_BadXMLDocument_2o "~BadXMLDocument_2o"
+#define ZED_BadXMLNoOpeningTag "~BadXMLNoOpeningTag"
+#define ZED_BadXMLForXQDoc_3 "~BadXMLForXQDoc_3"
+#define ZED_BadXQueryVersion "~BadXQueryVersion"
+#define ZED_Base64BadChar "~Base64BadChar"
+#define ZED_Base64Multiple4 "~Base64Multiple4"
+#define ZED_BaseURI "~BaseURI"
+#define ZED_BoxCondTooManyColumns "~BoxCondTooManyColumns"
+#define ZED_CastFromToFailed_34 "~CastFromToFailed_34"
+#define ZED_CharExpected_3 "~CharExpected_3"
+#define ZED_CloneNotImplemented "~CloneNotImplemented"
+#define ZED_ClosingBraceWithoutOpen "~ClosingBraceWithoutOpen"
+#define ZED_CollectionIteratorNotOpen "~CollectionIteratorNotOpen"
+#define ZED_DefaultCollection "~DefaultCollection"
+#define ZED_DefaultCollation "~DefaultCollation"
+#define ZED_DivisionNoINF "~DivisionNoINF"
+#define ZED_DivisionNoNaN "~DivisionNoNaN"
+#define ZED_DocNodeMultipleElements "~DocNodeMultipleElements"
+#define ZED_EBVNotDefSeq_5 "~EBVNotDefSeq_5"
+#define ZED_EffectiveBooleanValue "~EffectiveBooleanValue"
+#define ZED_ElementName "~ElementName"
+#define ZED_ElementNode "~ElementNode"
+#define ZED_EmptyPath "~EmptyPath"
+#define ZED_EmptySeqNoCastToQName "~EmptySeqNoCastToQName"
+#define ZED_EmptySeqNoCastToTypeWithQuantOne "~EmptySeqNoCastToTypeWithQuantOne"
+#define ZED_EmptySeqNoFnRemoveArg "~EmptySeqNoFnRemoveArg"
+#define ZED_EmptySeqNoSearchItem "~EmptySeqNoSearchItem"
+#define ZED_EmptySequence "~EmptySequence"
+#define ZED_ErrorCodeMessage_12 "~ErrorCodeMessage_12"
+#define ZED_ExpectedNumericOrDurationType "~ExpectedNumericOrDurationType"
+#define ZED_ExpectedNumericType "~ExpectedNumericType"
+#define ZED_ExpectedType_5 "~ExpectedType_5"
+#define ZED_ExprNoReturnUpdateList "~ExprNoReturnUpdateList"
+#define ZED_ExprReturnsTooManyUpdateLists "~ExprReturnsTooManyUpdateLists"
+#define ZED_ExternFnDeterministic "~ExternFnDeterministic"
+#define ZED_ExternFnNondeterministic "~ExternFnNondeterministic"
+#define ZED_FileNotFoundOrReadable "~FileNotFoundOrReadable"
+#define ZED_FnNilledArgNotNode "~FnNilledArgNotNode"
+#define ZED_FnOnlyInXQueryVersion_3 "~FnOnlyInXQueryVersion_3"
+#define ZED_FullTextNotEnabled "~FullTextNotEnabled"
+#define ZED_FunctionFailedErrorCodeMessage_234 "~FunctionFailedErrorCodeMessage_234"
+#define ZED_FunctionFailed_23o "~FunctionFailed_23o"
+#define ZED_FunctionUndeclared_3 "~FunctionUndeclared_3"
+#define ZED_GoodValuesAreUTF8 "~GoodValuesAreUTF8"
+#define ZED_GoodValuesAreXMLEtc "~GoodValuesAreXMLEtc"
+#define ZED_GoodValuesAreYesNo "~GoodValuesAreYesNo"
+#define ZED_GoodValuesAreYesNoOmit "~GoodValuesAreYesNoOmit"
+#define ZED_HexBinaryMustBeEven "~HexBinaryMustBeEven"
+#define ZED_IncompleteKeyInIndexBuild "~IncompleteKeyInIndexBuild"
+#define ZED_IncompleteKeyInIndexRefresh "~IncompleteKeyInIndexRefresh"
+#define ZED_LibModVersionMismatch_3 "~LibModVersionMismatch_3"
+#define ZED_ModuleNotFound "~ModuleNotFound"
+#define ZED_MustBeAbsoluteURI "~MustBeAbsoluteURI"
+#define ZED_MustBeNCName "~MustBeNCName"
+#define ZED_NoAttrNodesInDocument "~NoAttrNodesInDocument"
+#define ZED_NoBindURI "~NoBindURI"
+#define ZED_NoCastToCInt_2 "~NoCastToCInt_2"
+#define ZED_NoCastTo_34o "~NoCastTo_34o"
+#define ZED_NoCastTo_45o "~NoCastTo_45o"
+#define ZED_NoCompareTypes_23 "~NoCompareTypes_23"
+#define ZED_NoCompareWithType_4 "~NoCompareWithType_4"
+#define ZED_NoDriveSpecification "~NoDriveSpecification"
+#define ZED_NoEmptyLocalname "~NoEmptyLocalname"
+#define ZED_NoEmptySeqAsBaseURI "~NoEmptySeqAsBaseURI"
+#define ZED_NoEmptySeqAsCollationParam "~NoEmptySeqAsCollationParam"
+#define ZED_NoHashItemOfType_2 "~NoHashItemOfType_2"
+#define ZED_NoInputData "~NoInputData"
+#define ZED_NoModuleURIResolver "~NoModuleURIResolver"
+#define ZED_NoMultiKeyNodeValues_2 "~NoMultiKeyNodeValues_2"
+#define ZED_NoParseFnArity "~NoParseFnArity"
+#define ZED_NoRebindPrefix "~NoRebindPrefix"
+#define ZED_NoRegisteredSerializationCallback_2 "~NoRegisteredSerializationCallback_2"
+#define ZED_NoResolveRelativeURI "~NoResolveRelativeURI"
+#define ZED_NoSeqAsArithOp "~NoSeqAsArithOp"
+#define ZED_NoSeqAsCollationParam "~NoSeqAsCollationParam"
+#define ZED_NoSeqCastToTypeWithQuantOneOrQuestion "~NoSeqCastToTypeWithQuantOneOrQuestion"
+#define ZED_NoSeqForFnOp_2 "~NoSeqForFnOp_2"
+#define ZED_NoSeqForConcat "~NoSeqForConcat"
+#define ZED_NoSeqInValueComp "~NoSeqInValueComp"
+#define ZED_NoSeqTestedForAtomicEquiv "~NoSeqTestedForAtomicEquiv"
+#define ZED_NoSerializationCallbackForDocColMod "~NoSerializationCallbackForDocColMod"
+#define ZED_NoExternalFunction_2 "~NoExternalFunction_2"
+#define ZED_NoExternalModuleFromDLL_2 "~NoExternalModuleFromDLL_2"
+#define ZED_NoSerializationCallbackForModule "~NoSerializationCallbackForModule"
+#define ZED_NoSerializationCallbackForTraceStream "~NoSerializationCallbackForTraceStream"
+#define ZED_NoSourceURI "~NoSourceURI"
+#define ZED_NoTreatAs_4 "~NoTreatAs_4"
+#define ZED_NoTypeInCtx "~NoTypeInCtx"
+#define ZED_NoTypeInMainModule_4 "~NoTypeInMainModule_4"
+#define ZED_NoTypeInModule_45 "~NoTypeInModule_45"
+#define ZED_NoURIAuthority "~NoURIAuthority"
+#define ZED_NoURIInStore "~NoURIInStore"
+#define ZED_NoURIScheme "~NoURIScheme"
+#define ZED_NoUntypedKeyNodeValue_2 "~NoUntypedKeyNodeValue_2"
+#define ZED_NodeIDNeedsBytes_2 "~NodeIDNeedsBytes_2"
+#define ZED_NodeIDTooBig "~NodeIDTooBig"
+#define ZED_NonClosedBackRef_3 "~NonClosedBackRef_3"
+#define ZED_NonFileThesaurusURI "~NonFileThesaurusURI"
+#define ZED_NonLocalhostAuthority "~NonLocalhostAuthority"
+#define ZED_NonexistentBackRef_3 "~NonexistentBackRef_3"
+#define ZED_NotAllowedForTypeName "~NotAllowedForTypeName"
+#define ZED_NotAmongInScopeSchemaTypes "~NotAmongInScopeSchemaTypes"
+#define ZED_NotDefInDynamicCtx "~NotDefInDynamicCtx"
+#define ZED_NotDocOrElementNode "~NotDocOrElementNode"
+#define ZED_NotInStaticCtx "~NotInStaticCtx"
+#define ZED_NotPlainFile "~NotPlainFile"
+#define ZED_NotSpecified "~NotSpecified"
+#define ZED_OpIsSameNodeMustHaveNodes "~OpIsSameNodeMustHaveNodes"
+#define ZED_OpNodeAfterMustHaveNodes "~OpNodeAfterMustHaveNodes"
+#define ZED_OpNodeBeforeMustHaveNodes "~OpNodeBeforeMustHaveNodes"
+#define ZED_OperationNotDef_23 "~OperationNotDef_23"
+#define ZED_OperationNotPossibleWithTypes_234 "~OperationNotPossibleWithTypes_234"
+#define ZED_ParserInitFailed "~ParserInitFailed"
+#define ZED_ParserNoCreateTree "~ParserNoCreateTree"
+#define ZED_PromotionImpossible "~PromotionImpossible"
+#define ZED_QuotedColon_23 "~QuotedColon_23"
+#define ZED_SEPM0009_Not10 "~SEPM0009_Not10"
+#define ZED_SEPM0009_NotOmit "~SEPM0009_NotOmit"
+#define ZED_SchemaAttributeName "~SchemaAttributeName"
+#define ZED_SchemaElementName "~SchemaElementName"
+#define ZED_SchemaOutOfMemory "~SchemaOutOfMemory"
+#define ZED_SchemaParseError "~SchemaParseError"
+#define ZED_SchemaUnexpected "~SchemaUnexpected"
+#define ZED_SearchKeyTypeMismatch_234 "~SearchKeyTypeMismatch_234"
+#define ZED_SearchKeyTypeNoProbeIndex_23 "~SearchKeyTypeNoProbeIndex_23"
+#define ZED_SeqFnBody "~SeqFnBody"
+#define ZED_SeqNoCastToQName "~SeqNoCastToQName"
+#define ZED_SingletonExpected_2o "~SingletonExpected_2o"
+#define ZED_StackOverflow "~StackOverflow"
+#define ZED_StingLiteral "~StingLiteral"
+#define ZED_StringValue "~StringValue"
+#define ZED_SumImpossibleWithTypes_23 "~SumImpossibleWithTypes_23"
+#define ZED_TrailingChar_3 "~TrailingChar_3"
+#define ZED_TwoDecimalFormatsSameName_2 "~TwoDecimalFormatsSameName_2"
+#define ZED_TwoDefaultDecimalFormats "~TwoDefaultDecimalFormats"
+#define ZED_TypeIsNotSubtype "~TypeIsNotSubtype"
+#define ZED_U_REGEX_BAD_ESCAPE_SEQUENCE "~U_REGEX_BAD_ESCAPE_SEQUENCE"
+#define ZED_U_REGEX_BAD_INTERVAL "~U_REGEX_BAD_INTERVAL"
+#define ZED_U_REGEX_INTERNAL_ERROR "~U_REGEX_INTERNAL_ERROR"
+#define ZED_U_REGEX_INVALID_BACK_REF "~U_REGEX_INVALID_BACK_REF"
+#define ZED_U_REGEX_INVALID_FLAG "~U_REGEX_INVALID_FLAG"
+#define ZED_U_REGEX_INVALID_RANGE "~U_REGEX_INVALID_RANGE"
+#define ZED_U_REGEX_INVALID_STATE "~U_REGEX_INVALID_STATE"
+#define ZED_U_REGEX_LOOK_BEHIND_LIMIT "~U_REGEX_LOOK_BEHIND_LIMIT"
+#define ZED_U_REGEX_MAX_LT_MIN "~U_REGEX_MAX_LT_MIN"
+#define ZED_U_REGEX_MISMATCHED_PAREN "~U_REGEX_MISMATCHED_PAREN"
+#define ZED_U_REGEX_MISSING_CLOSE_BRACKET "~U_REGEX_MISSING_CLOSE_BRACKET"
+#define ZED_U_REGEX_NUMBER_TOO_BIG "~U_REGEX_NUMBER_TOO_BIG"
+#define ZED_U_REGEX_OCTAL_TOO_BIG "~U_REGEX_OCTAL_TOO_BIG"
+#define ZED_U_REGEX_PROPERTY_SYNTAX "~U_REGEX_PROPERTY_SYNTAX"
+#define ZED_U_REGEX_RULE_SYNTAX "~U_REGEX_RULE_SYNTAX"
+#define ZED_U_REGEX_SET_CONTAINS_STRING "~U_REGEX_SET_CONTAINS_STRING"
+#define ZED_U_REGEX_STACK_OVERFLOW "~U_REGEX_STACK_OVERFLOW"
+#define ZED_U_REGEX_STOPPED_BY_CALLER "~U_REGEX_STOPPED_BY_CALLER"
+#define ZED_U_REGEX_TIME_OUT "~U_REGEX_TIME_OUT"
+#define ZED_U_REGEX_UNIMPLEMENTED "~U_REGEX_UNIMPLEMENTED"
+#define ZED_REGEX_UNIMPLEMENTED "~REGEX_UNIMPLEMENTED"
+#define ZED_REGEX_MISMATCHED_PAREN "~REGEX_MISMATCHED_PAREN"
+#define ZED_REGEX_BROKEN_P_CONSTRUCT "~REGEX_BROKEN_P_CONSTRUCT"
+#define ZED_REGEX_UNKNOWN_PL_CONSTRUCT "~REGEX_UNKNOWN_PL_CONSTRUCT"
+#define ZED_REGEX_UNKNOWN_PM_CONSTRUCT "~REGEX_UNKNOWN_PM_CONSTRUCT"
+#define ZED_REGEX_UNKNOWN_PN_CONSTRUCT "~REGEX_UNKNOWN_PN_CONSTRUCT"
+#define ZED_REGEX_UNKNOWN_PP_CONSTRUCT "~REGEX_UNKNOWN_PP_CONSTRUCT"
+#define ZED_REGEX_UNKNOWN_PZ_CONSTRUCT "~REGEX_UNKNOWN_PZ_CONSTRUCT"
+#define ZED_REGEX_UNKNOWN_PS_CONSTRUCT "~REGEX_UNKNOWN_PS_CONSTRUCT"
+#define ZED_REGEX_UNKNOWN_PC_CONSTRUCT "~REGEX_UNKNOWN_PC_CONSTRUCT"
+#define ZED_REGEX_BROKEN_PIs_CONSTRUCT "~REGEX_BROKEN_PIs_CONSTRUCT"
+#define ZED_REGEX_UNKNOWN_PIs_CONSTRUCT "~REGEX_UNKNOWN_PIs_CONSTRUCT"
+#define ZED_REGEX_INVALID_UNICODE_CODEPOINT_u "~REGEX_INVALID_UNICODE_CODEPOINT_u"
+#define ZED_REGEX_UNKNOWN_ESC_CHAR "~REGEX_UNKNOWN_ESC_CHAR"
+#define ZED_REGEX_INVALID_BACK_REF "~REGEX_INVALID_BACK_REF"
+#define ZED_REGEX_INVALID_ATOM_CHAR "~REGEX_INVALID_ATOM_CHAR"
+#define ZED_REGEX_INVALID_SUBCLASS "~REGEX_INVALID_SUBCLASS"
+#define ZED_REGEX_INVALID_USE_OF_SUBCLASS "~REGEX_INVALID_USE_OF_SUBCLASS"
+#define ZED_REGEX_MULTICHAR_IN_CHAR_RANGE "~REGEX_MULTICHAR_IN_CHAR_RANGE"
+#define ZED_REGEX_MISSING_CLOSE_BRACKET "~REGEX_MISSING_CLOSE_BRACKET"
+#define ZED_REGEX_MAX_LT_MIN "~REGEX_MAX_LT_MIN"
+#define ZED_UnaryArithOp "~UnaryArithOp"
+#define ZED_UnbalancedChar_3 "~UnbalancedChar_3"
+#define ZED_UnescapedChar_3 "~UnescapedChar_3"
+#define ZED_UnexpectedElement "~UnexpectedElement"
+#define ZED_VarValMustBeSingleItem_2 "~VarValMustBeSingleItem_2"
+#define ZED_Variable "~Variable"
+#define ZED_VariabledHasNoValue "~VariabledHasNoValue"
+#define ZED_VariabledUndeclared "~VariabledUndeclared"
+#define ZED_XMLSchema "~XMLSchema"
+#define ZED_XUST0002_Transform "~XUST0002_Transform"
+#define ZED_XUST0002_UDF_2 "~XUST0002_UDF_2"
+#define ZED_ZeroLenURI "~ZeroLenURI"
+#define ZED_error "~error"
+#define ZED_format_integer_bad_picture_format "~format_integer_bad_picture_format"
+#define ZED_format_integer_duplicated_optional_format_modifier "~format_integer_duplicated_optional_format_modifier"
+#define ZED_format_integer_optional_format_modifier_not_closed "~format_integer_optional_format_modifier_not_closed"
+#define ZED_format_integer_picture_empty "~format_integer_picture_empty"
+#define ZED_format_integer_unknown_optional_format_modifier_character "~format_integer_unknown_optional_format_modifier_character"
+#define ZED_format_integer_value_1_10 "~format_integer_value_1_10"
+#define ZED_format_integer_value_1_20 "~format_integer_value_1_20"
+#define ZED_format_integer_value_gt_3000 "~format_integer_value_gt_3000"
+#define ZED_warning "~warning"
+#define ZED_xqueryx_empty_content "~xqueryx_empty_content"
+#define ZED_ParseFragmentOptionCombinationNotAllowed "~ParseFragmentOptionCombinationNotAllowed"
+#define ZED_ParseFragmentInvalidOptions "~ParseFragmentInvalidOptions"
+#define ZED_ParseFragmentDoctypeNotAllowed "~ParseFragmentDoctypeNotAllowed"
+#define ZED_ParseFragmentDoctypeNotAllowedHere "~ParseFragmentDoctypeNotAllowedHere"
+#define ZED_FormatNumberDuplicates "~FormatNumberDuplicates"
+#define ZED_FormatNumberGroupingAdjacentToDecimal "~FormatNumberGroupingAdjacentToDecimal"
+#define ZED_FormatNumberIntegerPart "~FormatNumberIntegerPart"
+#define ZED_FormatNumberFractionalPart "~FormatNumberFractionalPart"
+#define ZED_FormatNumberPercentPermille "~FormatNumberPercentPermille"
+#define ZED_FormatNumberAtLeastOneOptionalOrDecimal "~FormatNumberAtLeastOneOptionalOrDecimal"
+#define ZED_JSON_ILLEGAL_CHARACTER "~JSON_ILLEGAL_CHARACTER"
+#define ZED_JSON_ILLEGAL_CODEPOINT "~JSON_ILLEGAL_CODEPOINT"
+#define ZED_JSON_ILLEGAL_ESCAPE "~JSON_ILLEGAL_ESCAPE"
+#define ZED_JSON_ILLEGAL_LITERAL "~JSON_ILLEGAL_LITERAL"
+#define ZED_JSON_ILLEGAL_NUMBER "~JSON_ILLEGAL_NUMBER"
+#define ZED_JSON_UNEXPECTED_TOKEN "~JSON_UNEXPECTED_TOKEN"
+#define ZED_JSON_UNTERMINATED_STRING "~JSON_UNTERMINATED_STRING"
+#define ZED_JSON_UNEXPECTED_EXTRA_CONTENT "~JSON_UNEXPECTED_EXTRA_CONTENT"
+#define ZED_FUNCTION "~FUNCTION"
+#define ZED_ANNOTATION "~ANNOTATION"
+
+#endif /* ZORBA_DIAGNOSTICS_ZED_KEYS */
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */
+/* vim:set et sw=2 ts=2: */
=== modified file 'src/runtime/core/apply_updates.cpp'
--- src/runtime/core/apply_updates.cpp 2012-10-08 12:09:36 +0000
+++ src/runtime/core/apply_updates.cpp 2012-11-17 18:51:21 +0000
@@ -38,6 +38,7 @@
#include "common/shared_types.h"
#include "diagnostics/util_macros.h"
+#include "zorba/internal/system_diagnostic.h"
namespace zorba
@@ -232,32 +233,27 @@
}
catch (XQueryException& e)
{
- if (e.has_source() &&
- (e.diagnostic() == err::XUDY0021 ||
- e.diagnostic() == err::XUDY0015 ||
- e.diagnostic() == err::XUDY0016 ||
- e.diagnostic() == err::XUDY0017 ||
- e.diagnostic() == err::XUDY0014))
- {
- XQueryException lNewE =
- XQUERY_EXCEPTION(err::XUDY0021, ERROR_PARAMS(ZED(XUDY0021_AppliedAt), loc));
-
- QueryLoc lLoc;
- lLoc.setFilename(e.source_uri());
- lLoc.setLineBegin(e.source_line());
- lLoc.setColumnBegin(e.source_column());
- set_source(lNewE, lLoc);
- lNewE.set_diagnostic(e.diagnostic());
-
- throw lNewE;
+ if ( e.has_source() ) {
+ if ( e.diagnostic() == err::XUDY0021
+ || e.diagnostic() == err::XUDY0024
+ || e.diagnostic() == zerr::ZDDY0013_COLLECTION_BAD_DESTROY_INDEXES
+ || e.diagnostic() == zerr::ZDDY0014_COLLECTION_BAD_DESTROY_ICS
+ || e.diagnostic() == zerr::ZDDY0028_INDEX_DOMAIN_HAS_DUPLICATE_NODES
+ || e.diagnostic() == zerr::ZSTR0002_INDEX_DOES_NOT_EXIST
+ )
+ throw XQUERY_EXCEPTION(
+ err::XUDY0021,
+ ERROR_PARAMS( e.what(), ZED(XUDY0021_AppliedAt), loc ),
+ ERROR_LOC( e )
+ );
}
else
{
// exception raised by the store doesn't have a store location
// hence, we add the location of the apply expression
set_source(e, loc);
- throw;
}
+ throw;
}
}
@@ -265,6 +261,5 @@
UNARY_ACCEPT(ApplyIterator);
-
} // namespace zorba
/* vim:set et sw=2 ts=2: */
=== modified file 'src/runtime/core/fncall_iterator.cpp'
--- src/runtime/core/fncall_iterator.cpp 2012-10-19 20:42:38 +0000
+++ src/runtime/core/fncall_iterator.cpp 2012-11-17 18:51:21 +0000
@@ -711,7 +711,7 @@
throw ZORBA_EXCEPTION(
zerr::ZCSE0013_UNABLE_TO_LOAD_QUERY,
ERROR_PARAMS(
- ZED( NoExternalFunction ),
+ ZED( NoExternalFunction_2 ),
BUILD_STRING( '{', theNamespace, '}', lLocalname )
)
);
=== modified file 'src/runtime/core/sequencetypes.cpp'
--- src/runtime/core/sequencetypes.cpp 2012-10-24 11:32:56 +0000
+++ src/runtime/core/sequencetypes.cpp 2012-11-17 18:51:21 +0000
@@ -468,7 +468,7 @@
assert(theQName != NULL);
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_FuncReturn),
+ ERROR_PARAMS(ZED(XPTY0004_NoReturnTypePromote_234),
valueType, targetType, theQName->getStringValue()));
break;
}
@@ -477,14 +477,14 @@
assert(theQName != NULL);
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_FuncParam),
+ ERROR_PARAMS(ZED(XPTY0004_NoParamTypePromote_234),
valueType, targetType, theQName->getStringValue()));
break;
}
case PROMOTE_TYPE_PROMOTION:
{
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_TypePromotion), valueType, targetType));
+ ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23), valueType, targetType));
break;
}
#ifdef ZORBA_WITH_JSON
@@ -670,7 +670,7 @@
assert(theQName != NULL);
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_FuncReturn),
+ ERROR_PARAMS(ZED(XPTY0004_NoReturnTypePromote_234),
valueType, targetType, theQName->getStringValue()));
break;
}
@@ -679,14 +679,14 @@
assert(theQName != NULL);
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_FuncParam),
+ ERROR_PARAMS(ZED(XPTY0004_NoParamTypePromote_234),
valueType, targetType, theQName->getStringValue()));
break;
}
case TREAT_TYPE_MATCH:
{
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_TypeMatch), valueType, targetType));
+ ERROR_PARAMS(ZED(XPTY0004_NoTreatAs_23), valueType, targetType));
break;
}
case TREAT_EXPR:
@@ -742,8 +742,7 @@
}
case TREAT_JSONIQ_OBJECT_UPDATE_CONTENT:
{
- RAISE_ERROR(jerr::JNUP0019, loc,
- ERROR_PARAMS(ZED(JNUP0019), valueType));
+ RAISE_ERROR(jerr::JNUP0019, loc, ERROR_PARAMS(valueType));
break;
}
case TREAT_JSONIQ_ARRAY_UPDATE_TARGET:
=== modified file 'src/runtime/function_item/dynamic_fncall_iterator.cpp'
--- src/runtime/function_item/dynamic_fncall_iterator.cpp 2012-09-19 21:16:15 +0000
+++ src/runtime/function_item/dynamic_fncall_iterator.cpp 2012-11-17 18:51:21 +0000
@@ -167,7 +167,7 @@
if (!consumeNext(targetItem, theChildren[0], planState))
{
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_TypePromotion),
+ ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23),
"empty-sequence()",
GENV_TYPESYSTEM.ANY_FUNCTION_TYPE_ONE->toSchemaString()));
}
@@ -177,7 +177,7 @@
if (consumeNext(item, theChildren[0], planState))
{
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_NoMultiSeqTypePromotion),
+ ERROR_PARAMS(ZED(XPTY0004_NoMultiSeqTypePromotion_2),
GENV_TYPESYSTEM.ANY_FUNCTION_TYPE_ONE->toSchemaString()));
}
@@ -308,7 +308,7 @@
xqtref_t type = tm->create_value_type(targetItem);
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_TypePromotion),
+ ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23),
type->toSchemaString(),
GENV_TYPESYSTEM.ANY_FUNCTION_TYPE_ONE->toSchemaString()));
}
=== modified file 'src/runtime/json/jsoniq_functions_impl.cpp'
--- src/runtime/json/jsoniq_functions_impl.cpp 2012-10-24 12:49:43 +0000
+++ src/runtime/json/jsoniq_functions_impl.cpp 2012-11-17 18:51:21 +0000
@@ -1160,7 +1160,7 @@
xqtref_t type = tm->create_value_type(selector, loc);
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_NoTypePromotion_23),
+ ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23),
type->toSchemaString(),
GENV_TYPESYSTEM.INTEGER_TYPE_ONE->toSchemaString()));
}
@@ -1178,7 +1178,7 @@
xqtref_t type = tm->create_value_type(selector, loc);
RAISE_ERROR(err::XPTY0004, loc,
- ERROR_PARAMS(ZED(XPTY0004_NoTypePromotion_23),
+ ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23),
type->toSchemaString(),
GENV_TYPESYSTEM.STRING_TYPE_ONE->toSchemaString()));
}
=== modified file 'src/runtime/numerics/numerics_impl.cpp'
--- src/runtime/numerics/numerics_impl.cpp 2012-09-19 21:16:15 +0000
+++ src/runtime/numerics/numerics_impl.cpp 2012-11-17 18:51:21 +0000
@@ -883,7 +883,7 @@
if (!isAllowedType(result->getType()))
{
RAISE_ERROR(err::XPTY0004, info.loc,
- ERROR_PARAMS(ZED(FormatNumber_2), result->getType()->getStringValue()));
+ ERROR_PARAMS(ZED(XPTY0004_FormatNumber_2), result->getType()->getStringValue()));
}
consumeNext(pictureItem, theChildren[1].getp(), planState);
=== modified file 'src/store/naive/node_items.cpp'
--- src/store/naive/node_items.cpp 2012-10-12 09:05:54 +0000
+++ src/store/naive/node_items.cpp 2012-11-17 18:51:21 +0000
@@ -3224,7 +3224,8 @@
if (!otherAttr->isHidden() && otherAttr->getNodeName()->equals(attrName))
{
- throw XQUERY_EXCEPTION(err::XUDY0021, ERROR_PARAMS(attrName->getStringValue()));
+ throw XQUERY_EXCEPTION(err::XUDY0021,
+ ERROR_PARAMS(ZED(XUDY0021_AttributeName), "", attrName->getStringValue()));
}
}
}
=== modified file 'src/store/naive/pul_primitives.cpp'
--- src/store/naive/pul_primitives.cpp 2012-09-19 21:16:15 +0000
+++ src/store/naive/pul_primitives.cpp 2012-11-17 18:51:21 +0000
@@ -314,7 +314,14 @@
void UpdInsertAttributes::apply()
{
theIsApplied = true;
- ELEM_NODE(theTarget)->insertAttributes(*this);
+ try
+ {
+ ELEM_NODE(theTarget)->insertAttributes(*this);
+ } catch (ZorbaException& e)
+ {
+ set_source(e, *theLoc);
+ throw;
+ }
}
@@ -364,8 +371,15 @@
void UpdReplaceAttribute::apply()
{
- theIsApplied = true;
- ELEM_NODE(theTarget)->replaceAttribute(*this);
+ try
+ {
+ ELEM_NODE(theTarget)->replaceAttribute(*this);
+ theIsApplied = true;
+ } catch (ZorbaException& e)
+ {
+ set_source(e, *theLoc);
+ throw;
+ }
}
@@ -463,8 +477,15 @@
********************************************************************************/
void UpdRenameElem::apply()
{
- ELEM_NODE(theTarget)->replaceName(*this);
- theIsApplied = true;
+ try
+ {
+ ELEM_NODE(theTarget)->replaceName(*this);
+ theIsApplied = true;
+ } catch (ZorbaException& e)
+ {
+ set_source(e, *theLoc);
+ throw;
+ }
}
@@ -612,8 +633,15 @@
********************************************************************************/
void UpdRenameAttr::apply()
{
- ATTR_NODE(theTarget)->replaceName(*this);
- theIsApplied = true;
+ try
+ {
+ ATTR_NODE(theTarget)->replaceName(*this);
+ theIsApplied = true;
+ } catch (ZorbaException& e)
+ {
+ set_source(e, *theLoc);
+ throw;
+ }
}
=== modified file 'src/util/error_util.cpp'
--- src/util/error_util.cpp 2012-09-19 21:16:15 +0000
+++ src/util/error_util.cpp 2012-11-17 18:51:21 +0000
@@ -61,7 +61,7 @@
if ( function && *function ) {
using namespace internal::diagnostic;
parameters::value_type result =
- diagnostic::dict::lookup( ZED( FunctionFailed_12o ) );
+ diagnostic::dict::lookup( ZED( FunctionFailed_23o ) );
parameters const params( ERROR_PARAMS( function, err_string ) );
params.substitute( &result );
return result;
@@ -77,7 +77,7 @@
parameters::value_type result;
if ( function && *function ) {
result = diagnostic::dict::lookup(
- ZED( FunctionFailedErrorCodeMessage_123 )
+ ZED( FunctionFailedErrorCodeMessage_234 )
);
params = ERROR_PARAMS( function, code, err_string );
} else {
=== modified file 'test/rbkt/ExpQueryResults/zorba/index/auctions2u.xml.res'
--- test/rbkt/ExpQueryResults/zorba/index/auctions2u.xml.res 2012-07-03 03:12:05 +0000
+++ test/rbkt/ExpQueryResults/zorba/index/auctions2u.xml.res 2012-11-17 18:51:21 +0000
@@ -256,7 +256,7 @@
TEST 6 (undo without do):
-<exception>err:XUDY0021 : updates violate constraint</exception><person id="person1"><watches>
+<exception>err:XUDY0021 : "id": attribute with the same name already exists</exception><person id="person1"><watches>
<watch open_auction="open_auction2"/>
<watch open_auction="open_auction4"/>
<watch open_auction="open_auction5"/>
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_06.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_06.xml.res 2012-09-11 15:38:58 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_06.xml.res 2012-11-17 18:51:21 +0000
@@ -1,1 +1,1 @@
-Cannot atomize an object item. An object has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item).
+can not atomize an object item: an object has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item)
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_10.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_10.xml.res 2012-09-11 15:38:58 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_10.xml.res 2012-11-17 18:51:21 +0000
@@ -1,1 +1,1 @@
-Cannot atomize an array item. An array has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item).
+can not atomize an array item: an array has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item)
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res 2012-09-13 12:51:41 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res 2012-11-17 18:51:21 +0000
@@ -1,1 +1,1 @@
-html: invalid serialization method for item type (js:object) text: invalid serialization method for item type (js:object) xml: invalid serialization method for item type (js:object) xhtml: invalid serialization method for item type (js:object)
+"html": invalid serialization method for item type (js:object) "text": invalid serialization method for item type (js:object) "xml": invalid serialization method for item type (js:object) "xhtml": invalid serialization method for item type (js:object)
=== modified file 'test/rbkt/Queries/zorba/index/auctions2u.xq'
--- test/rbkt/Queries/zorba/index/auctions2u.xq 2012-07-03 03:12:05 +0000
+++ test/rbkt/Queries/zorba/index/auctions2u.xq 2012-11-17 18:51:21 +0000
@@ -162,7 +162,7 @@
}}
catch *
{
- <exception>{$err:code} : {$err:description}</exception>
+ <exception>{$err:code} : {substring-before($err:description, " (applied")}</exception>
}
,
for $x in auctions:probe-point-watch($auctions:PersonWatches,
Follow ups
-
Re: [Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Zorba Build Bot, 2012-11-25
-
[Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Zorba Build Bot, 2012-11-25
-
[Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Paul J. Lucas, 2012-11-25
-
[Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Zorba Build Bot, 2012-11-25
-
Re: [Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Zorba Build Bot, 2012-11-25
-
[Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Paul J. Lucas, 2012-11-25
-
Re: [Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Markos Zaharioudakis, 2012-11-25
-
Re: [Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Matthias Brantner, 2012-11-24
-
[Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Paul J. Lucas, 2012-11-17
-
Re: [Merge] lp:~zorba-coders/zorba/bug-1044260 into lp:zorba
From: Paul J. Lucas, 2012-11-17