Confusing parser error for scripting error

Bug #1071832 reported by Till Westmann
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Nicolae Brinza

Bug Description

This query:

declare namespace an = "http://www.zorba-xquery.com/annotations";

declare %an:sequential function local:func($a, $b) {
  if ($a) then {
    ();
  } else {
    if ($b) then {
      ();
      local:func(false(), false()) (: forgot semicolon :)
      local:func(true(), false());
    } else {
      ();
    }
  }
};

local:func(false(), true())

reports this error:

<...>:4,9: static error [err:XPST0003]: invalid expression: syntax error, unexpected ExprSingle (missing comma "," between expressions?)

This is quite difficult to find as
a) the error message does not seem to be related to the problem and
b) the error location points to line 4 while the problem is in line 9

(Of course in the real example there was a lot more code between the error and the indicated error location).

Revision history for this message
Till Westmann (tillw) wrote :

Also check the information in bug# 1072644

Changed in zorba:
milestone: none → 2.8
status: New → Confirmed
Nicolae Brinza (nbrinza)
Changed in zorba:
status: Confirmed → Fix Committed
Changed in zorba:
milestone: 2.8 → 2.9
Chris Hillery (ceejatec)
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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