← Back to team overview

zorba-coders team mailing list archive

[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)
Related bugs:
  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/125297

ZED keys are now compile-time checked for existence.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1044260/+merge/125297
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2012-09-18 22:11:29 +0000
+++ src/compiler/translator/translator.cpp	2012-09-19 18:33:21 +0000
@@ -6172,7 +6172,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);
   }
@@ -6391,7 +6391,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;
 }
@@ -7089,7 +7089,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;
 }
@@ -7153,7 +7153,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);
@@ -7552,7 +7552,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-09-17 00:36:37 +0000
+++ src/context/static_context.cpp	2012-09-19 18:33: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-17 00:36:37 +0000
+++ src/diagnostics/CMakeLists.txt	2012-09-19 18:33: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_en.xml'
--- src/diagnostics/diagnostic_en.xml	2012-09-18 16:29:31 +0000
+++ src/diagnostics/diagnostic_en.xml	2012-09-19 18:33: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>
 
     </diagnostic>
@@ -1964,11 +2003,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 ////////////////////////-->
@@ -2442,7 +2481,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 ////////////////////////////////////////-->
@@ -2515,6 +2554,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>
@@ -2561,17 +2601,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)">
@@ -2584,14 +2624,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>
@@ -2617,7 +2657,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">
@@ -2625,7 +2665,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>
@@ -2651,7 +2691,7 @@
       jsoniq-serialization-multiple-items is set to no.
       </comment>
 
-      <value>Cannot serialize multiple top-level items as JSON</value>
+      <value>can not serialize multiple top-level items as JSON</value>
     </diagnostic>
 
     <diagnostic code="JNSE0013" if="defined(ZORBA_WITH_JSON)">
@@ -2660,20 +2700,20 @@
       the jsoniq-serialization-extensions serialization parameter
       set to false.</comment>
 
-      <value>Cannot serialize value as JSON: $1</value>
+      <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 with the
       JSON output method.</comment>
-      <value>Cannot serialize a function item as JSON</value>
+      <value>can not serialize a function item as JSON</value>
     </diagnostic>
 
     <diagnostic code="JNSE0022" if="defined(ZORBA_WITH_JSON)">
       <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)">
@@ -2682,29 +2722,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>
     
     <!--////////// JSONIQ ///////////////////////////////////////////-->
@@ -2751,7 +2791,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">
@@ -2971,6 +3011,10 @@
       <value>collection iterator not open</value>
     </entry>
 
+    <entry key="DefaultCollection">
+      <value>default collection</value>
+    </entry>
+
     <entry key="DefaultCollation">
       <value>default collation</value>
     </entry>
@@ -3071,11 +3115,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>
 
@@ -3239,6 +3283,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-17 00:36:37 +0000
+++ src/diagnostics/dict.h	2012-09-19 18:33: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-09-19 18:33: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/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp	2012-09-18 16:29:31 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp	2012-09-19 18:33:21 +0000
@@ -98,43 +98,43 @@
   { "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." },
-#endif
-#if defined(ZORBA_WITH_JSON)
-  { "JNSE0012", "Cannot serialize multiple top-level items as JSON" },
-#endif
-#if defined(ZORBA_WITH_JSON)
-  { "JNSE0013", "Cannot serialize value as JSON: $1" },
-#endif
-#if defined(ZORBA_WITH_JSON)
-  { "JNSE0014", "Cannot serialize a 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." },
+  { "JNDY0003", "\"$1\": pair with the same name already exists in object" },
+#endif
+#if defined(ZORBA_WITH_JSON)
+  { "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 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)
   { "JNTY0003", "$1 items do not have string value" },
 #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)." },
+  { "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)
   { "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" },
@@ -149,10 +149,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\": content of insert expression must evaluate to a sequence of objects" },
 #endif
 #if defined(ZORBA_WITH_JSON)
   { "JSDY0020", "$1: invalid option type for option $2 (expected $3)" },
@@ -319,8 +319,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" },
@@ -454,10 +454,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" },
@@ -558,6 +558,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" },
@@ -592,8 +593,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" },
@@ -607,10 +608,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}" },
@@ -646,6 +647,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" },
@@ -859,24 +862,24 @@
   { "~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_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_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_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" },
   { "~XUST0001_CONCAT", "comma expression with updating and non-updating branches" },

=== 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-09-19 18:33:21 +0000
@@ -0,0 +1,329 @@
+/**
+ * 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_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_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_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_AtomizationOfGroupByMakesMoreThanOneItem "~AtomizationOfGroupByMakesMoreThanOneItem"
+#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_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_GroupByVarHasMoreThanOneItem_2 "~GroupByVarHasMoreThanOneItem_2"
+#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"
+
+#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-09-17 00:36:37 +0000
+++ src/runtime/core/apply_updates.cpp	2012-09-19 18:33:21 +0000
@@ -239,6 +239,7 @@
          e.diagnostic() == err::XUDY0017 ||
          e.diagnostic() == err::XUDY0014)) 
     {
+#if 0 /* pjl */
       XQueryException lNewE = 
       XQUERY_EXCEPTION(err::XUDY0021, ERROR_PARAMS(ZED(XUDY0021_AppliedAt), loc));
 
@@ -250,6 +251,7 @@
       lNewE.set_diagnostic(e.diagnostic());
 
       throw lNewE;
+#endif
     }
     else
     {

=== modified file 'src/runtime/core/fncall_iterator.cpp'
--- src/runtime/core/fncall_iterator.cpp	2012-09-17 00:36:37 +0000
+++ src/runtime/core/fncall_iterator.cpp	2012-09-19 18:33:21 +0000
@@ -708,7 +708,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-09-17 00:36:37 +0000
+++ src/runtime/core/sequencetypes.cpp	2012-09-19 18:33: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 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 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:
@@ -736,8 +736,7 @@
   }
   case JSONIQ_OBJECT_UPDATE_CONTENT:
   {
-    RAISE_ERROR(jerr::JNUP0019, loc,
-    ERROR_PARAMS(ZED(JNUP0019), valueType));
+    RAISE_ERROR(jerr::JNUP0019, loc, ERROR_PARAMS(valueType));
     break;
   }
   case JSONIQ_ARRAY_UPDATE_TARGET:

=== modified file 'src/runtime/function_item/dynamic_fncall_iterator.cpp'
--- src/runtime/function_item/dynamic_fncall_iterator.cpp	2012-09-17 00:36:37 +0000
+++ src/runtime/function_item/dynamic_fncall_iterator.cpp	2012-09-19 18:33: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-09-17 00:36:37 +0000
+++ src/runtime/json/jsoniq_functions_impl.cpp	2012-09-19 18:33:21 +0000
@@ -474,7 +474,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()));
     }
@@ -492,7 +492,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-17 00:36:37 +0000
+++ src/runtime/numerics/numerics_impl.cpp	2012-09-19 18:33: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/util/error_util.cpp'
--- src/util/error_util.cpp	2012-09-17 00:36:37 +0000
+++ src/util/error_util.cpp	2012-09-19 18:33: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 {


Follow ups