broken error location
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(
{
variable $svg-width := $obj("size"
variable $svg-height := $obj("size"
if ($width) then
{
$svg-width := $width;
}
else if ($height) then
{
$svg-width := xs:int(($svg-width div $svg-height) * $height);
}
else if ($ratio) then
{
$svg-width := xs:int($svg-width * $ratio);
}
else
{}
$svg := <a>{$svg}</a>/*;
replace value of node $svg/@width width xs:string(
replace value of node $svg/@height width xs:string(
}
else
{}
}
};
Error Msg:
========
</Users/
Actual Problem:
============
replace expressions contain a typo: s/width/with
Related branches
- Cezar Andrei: Approve
- Nicolae Brinza: Approve
-
Diff: 27986 lines (+3970/-3837)13 files modifiedsrc/compiler/parser/jsoniq_parser.cpp (+1545/-1531)
src/compiler/parser/jsoniq_parser.hpp (+6/-6)
src/compiler/parser/jsoniq_scanner.cpp (+371/-385)
src/compiler/parser/parser.y (+31/-10)
src/compiler/parser/xquery_parser.cpp (+1533/-1519)
src/compiler/parser/xquery_parser.hpp (+6/-6)
src/compiler/parser/xquery_scanner.cpp (+366/-380)
test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-semicolon-06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-semicolon-07.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-semicolon-08.xml.res (+1/-0)
test/rbkt/Queries/zorba/parser/syntax-errors/missing-semicolon-06.xq (+34/-0)
test/rbkt/Queries/zorba/parser/syntax-errors/missing-semicolon-07.xq (+34/-0)
test/rbkt/Queries/zorba/parser/syntax-errors/missing-semicolon-08.xq (+41/-0)
Changed in zorba: | |
importance: | Undecided → Medium |
assignee: | nobody → Markos Zaharioudakis (markos-za) |
milestone: | none → 2.8 |
status: | New → Confirmed |
description: | updated |
Changed in zorba: | |
status: | Confirmed → Fix Committed |
Changed in zorba: | |
milestone: | 2.8 → none |
status: | Fix Committed → Fix Released |
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?)
--