← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba

 

Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/pjl-misc into lp:zorba.

Commit message:
Fixed set_applied().

Requested reviews:
  Paul J. Lucas (paul-lucas)

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/146549

Fixed set_applied().
-- 
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/146549
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/diagnostics/xquery_exception.h'
--- src/diagnostics/xquery_exception.h	2012-12-01 00:06:15 +0000
+++ src/diagnostics/xquery_exception.h	2013-02-05 04:58:17 +0000
@@ -235,10 +235,10 @@
 ////////// XQuery diagnostic "applied at" location ////////////////////////////
 
 /**
- * Sets the XQuery source location of the given ZorbaException but only if it's
- * actually an XQueryException.  If it's actually a ZorbaException, constructs
- * a new XQueryException (copying the information from the ZorbaException) and
- * throws it.
+ * Sets the XQuery "applied at" location of the given ZorbaException but only
+ * if it's actually an XQueryException.  If it's actually a ZorbaException,
+ * constructs a new XQueryException (copying the information from the
+ * ZorbaException) and throws it.
  *
  * @param ze The ZorbaException to set the location of.
  * @param file The XQuery file name.
@@ -258,8 +258,10 @@
                   bool overwrite = true );
 
 /**
- * Sets the XQuery source location of the given ZorbaException but only if it's
- * actually an XQueryException.
+ * Sets the XQuery "applied at" location of the given ZorbaException but only
+ * if it's actually an XQueryException.  If it's actually a ZorbaException,
+ * constructs a new XQueryException (copying the information from the
+ * ZorbaException) and throws it.
  *
  * @tparam StringType The \a file string type.
  * @param ze The ZorbaException to set the location of.
@@ -274,17 +276,19 @@
  */
 template<class StringType> inline
 void set_applied( ZorbaException &ze, StringType const &file,
-                 XQueryException::line_type line,
-                 XQueryException::column_type col,
-                 XQueryException::line_type line_end,
-                 XQueryException::column_type col_end,
-                 bool overwrite = true ) {
+                  XQueryException::line_type line,
+                  XQueryException::column_type col,
+                  XQueryException::line_type line_end,
+                  XQueryException::column_type col_end,
+                  bool overwrite = true ) {
   set_applied( ze, file.c_str(), line, col, line_end, col_end, overwrite );
 }
 
 /**
- * Sets the XQuery source location of the given ZorbaException but only if it's
- * actually an XQueryException.
+ * Sets the XQuery "applied at" location of the given ZorbaException but only
+ * if it's actually an XQueryException.  If it's actually a ZorbaException,
+ * constructs a new XQueryException (copying the information from the
+ * ZorbaException) and throws it.
  *
  * @param ze The ZorbaException to set the location of.
  * @param loc The query location.
@@ -293,7 +297,7 @@
  * exception already has one.
  */
 inline void set_applied( ZorbaException &ze, QueryLoc const &loc,
-                        bool overwrite = true ) {
+                         bool overwrite = true ) {
   set_applied(
     ze,
     loc.getFilename(),
@@ -306,8 +310,10 @@
 }
 
 /**
- * Sets the XQuery source location of the given ZorbaException but only if it's
- * actually an XQueryException.
+ * Sets the XQuery "applied at" location of the given ZorbaException but only
+ * if it's actually an XQueryException.  If it's actually a ZorbaException,
+ * constructs a new XQueryException (copying the information from the
+ * ZorbaException) and throws it.
  *
  * @param to The ZorbaException to set the location of.
  * @param from The ZorbaException to get the location from but only if it's
@@ -317,16 +323,16 @@
  * exception already has one.
  */
 inline void set_applied( ZorbaException &to, ZorbaException const &from,
-                        bool overwrite = true ) {
+                         bool overwrite = true ) {
   if ( XQueryException const *const xe =
         dynamic_cast<XQueryException const*>( &from ) ) {
     set_applied(
       to,
-      xe->source_uri(),
-      xe->source_line(),
-      xe->source_column(),
-      xe->source_line_end(),
-      xe->source_column_end(),
+      xe->applied_uri(),
+      xe->applied_line(),
+      xe->applied_column(),
+      xe->applied_line_end(),
+      xe->applied_column_end(),
       overwrite
     );
   }


Follow ups