broken error location

Bug #1072644 reported by David Graf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Medium
Nicolae Brinza

Bug Description

Query:
=====

 declare %an:sequential function local:image(
   $id as xs:string, $width as xs:int*,
   $height as xs:int*, $ratio as xs:decimal*, $format as xs:string) as xs:base64Binary
 {
   variable $obj := null;

   if (fn:empty($obj)) then
     ()
   else
   {
     variable $svg := $obj("svg");
     if (fn:not(jn:is-null($obj("size")("width")))) then
     {
       variable $svg-width := $obj("size")("width");
       variable $svg-height := $obj("size")("height");

       if ($width) then
       {
         $svg-height := xs:int(($svg-height div $svg-width) * $width);
         $svg-width := $width;
       }
       else if ($height) then
       {
         $svg-width := xs:int(($svg-width div $svg-height) * $height);
         $svg-height := $height;
       }
       else if ($ratio) then
       {
         $svg-width := xs:int($svg-width * $ratio);
         $svg-height := xs:int($svg-height * $ratio);
       }
       else
         {}

       $svg := <a>{$svg}</a>/*;

       replace value of node $svg/@width width xs:string($svg-width) || "px";
       replace value of node $svg/@height width xs:string($svg-height) || "px";
     }
     else
     {}
   }
 };

Error Msg:
========
</Users/dagraf/work/28msec/zorba/build/test.xq>:7,22: static error [err:XPST0003]: invalid expression: syntax error, unexpected ExprSingle (missing comma "," between expressions?); raised at /Users/dagraf/work/28msec/zorba/sandbox/src/compiler/api/compiler_api.cpp:197

Actual Problem:
============
replace expressions contain a typo: s/width/with

Related branches

Chris Hillery (ceejatec)
Changed in zorba:
importance: Undecided → Medium
assignee: nobody → Markos Zaharioudakis (markos-za)
milestone: none → 2.8
status: New → Confirmed
Revision history for this message
Nicolae Brinza (nbrinza) wrote :

More info from David:

variable $x := <a b="c"/>;

declare function local:test($a)
{
  $a
};

local:test($x)

The error seems to happen when "keywords" located in scripting code are missing or are containing typos. Unfortunately, the error message always contains a completely useless location and error msg. In larger xquery modules, this is super annoying. Basically, the error message is then completely useless and I need a lot of time to find the problem.

Chris' suggestion:

For better clarity, I might phrase the message

  syntax error, unexpected expression (did you forget a comma "," between expressions?)

--

Changed in zorba:
assignee: Markos Zaharioudakis (markos-za) → Nicolae Brinza (nbrinza)
Nicolae Brinza (nbrinza)
description: updated
Changed in zorba:
status: Confirmed → Fix Committed
Nicolae Brinza (nbrinza)
Changed in zorba:
milestone: 2.8 → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.