← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/bug-867209 into lp:zorba

 

Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug-867209 into lp:zorba.

Commit message:
fix for bug 867209: improved error message for XQST0045

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Till Westmann (tillw)
Related bugs:
  Bug #867209 in Zorba: "Very confusing message for err:XQST0045"
  https://bugs.launchpad.net/zorba/+bug/867209

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-867209/+merge/131074

fix for bug 867209: improved error message for XQST0045
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-867209/+merge/131074
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2012-10-22 15:10:23 +0000
+++ src/compiler/translator/translator.cpp	2012-10-23 19:12:19 +0000
@@ -3478,7 +3478,7 @@
         ns == XQUERY_MATH_FN_NS)
     {
       RAISE_ERROR(err::XQST0045, func_decl->get_location(),
-      ERROR_PARAMS(qnameItem->getLocalName()));
+      ERROR_PARAMS(qnameItem->getLocalName(), ZED(FUNCTION), ns));
     }
 
     if (! theModuleNamespace.empty() && ns != theModuleNamespace)
@@ -4121,8 +4121,7 @@
     if (AnnotationInternal::lookup(lExpandedQName) == AnnotationInternal::zann_end)
     {
       RAISE_ERROR(err::XQST0045, loc,
-      ERROR_PARAMS( "%" + ("\"" + lExpandedQName->getNamespace() + "\""
-                    + ":" + lExpandedQName->getLocalName())));
+      ERROR_PARAMS(lExpandedQName->getLocalName(), ZED(ANNOTATION), annotNS));
     }
 
     //recognised = true;

=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml	2012-10-09 15:28:45 +0000
+++ src/diagnostics/diagnostic_en.xml	2012-10-23 19:12:19 +0000
@@ -377,7 +377,7 @@
        <code>http://www.w3.org/2001/XMLSchema-instance</code>,
        <code>http://www.w3.org/2005/xpath-functions</code>.
       </comment>
-      <value>"$1": invalid function or annotation namespace</value>
+      <value>"$1": $2 declared in reserved namespace${ 3}</value>
     </diagnostic>
 
     <diagnostic code="XQST0046">
@@ -4009,6 +4009,14 @@
       <value>unexpected extra content at the end of the document (consider using the jsoniq-multiple-top-level-items option)</value>
     </entry>
 
+    <entry key="FUNCTION">
+      <value>function</value>
+    </entry>
+
+    <entry key="ANNOTATION">
+      <value>annotation</value>
+    </entry>
+
   </subvalues>
 
 </diagnostic-list>

=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp	2012-10-09 15:28:45 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp	2012-10-23 19:12:19 +0000
@@ -216,7 +216,7 @@
   { "XQST0038", "multiple default collation declarations" },
   { "XQST0039", "\"$1\": duplicate parameter name" },
   { "XQST0040", "\"$1\": non-distinct expanded attribute QName" },
-  { "XQST0045", "\"$1\": invalid function or annotation namespace" },
+  { "XQST0045", "\"$1\": $2 declared in reserved namespace${ 3}" },
   { "XQST0046", "${\"1\": }invalid URI literal${: 2}" },
   { "XQST0047", "\"$1\": duplicate target namespace" },
   { "XQST0048", "\"$1\": not in library namespace" },
@@ -507,6 +507,7 @@
 #if !defined(ZORBA_NO_FULL_TEXT)
   { "ZXQP8403", "thesaurus data error${: 1}" },
 #endif
+  { "~ANNOTATION", "annotation" },
   { "~AllMatchesHasExcludes", "AllMatches contains StringExclude" },
   { "~AlreadySpecified", "already specified" },
   { "~ArithOpNotDefinedBetween_23", "arithmetic operation not defined between types \"$2\" and \"$3\"" },
@@ -583,6 +584,7 @@
   { "~FTST0009_BadStopWordsLang", "for current stop words" },
   { "~FTST0009_BadThesaurusLang", "for given thesaurus" },
   { "~FTST0009_BadTokenizerLang", "for current tokenizer" },
+  { "~FUNCTION", "function" },
   { "~FileNotFoundOrReadable", "file not found or readable" },
   { "~FnNilledArgNotNode", "fn:nilled() argument not a node" },
   { "~FnOnlyInXQueryVersion_3", "function only available in XQuery $3" },


Follow ups