Parsing error not explicit enough

Bug #866958 reported by William Candillon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Critical
Nicolae Brinza

Bug Description

The following query:
<root>
<foo>
<bar>
</foo>
</root>

Returns the following error:
line 5, column 7: [XPST0003] syntax error, unexpected end of file, no closing tag for direct element constructor

This message and the error location should be improved (line 4, mismatch for closing element ...)

Related branches

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

Marked with Resolution = None at Dana's request.

Changed in zorba:
assignee: nobody (nobody-users) → Nicolae Brinza (nbrinza)
importance: Medium → Critical
milestone: none → 2.8
Revision history for this message
Nicolae Brinza (nbrinza) wrote :

I have fixed a similar issue, so the current error message is this:

Compilation error: <bad.xq>:3,1: static error [err:XPST0003]: invalid expression: syntax error, end tag </foo> does not match start tag <bar>; raised at /home/colea/xquery_bzr/hof/src/compiler/api/compiler_api.cpp:195

I think it is explicit enough, but I could still improve it if you have suggestions for a better message.

Revision history for this message
Chris Hillery (ceejatec) wrote :

William - please check with the latest Zorba build and see if you agree the error message is sufficient now. If so, please mark this bug Fix Committed. Thanks.

Changed in zorba:
assignee: Nicolae Brinza (nbrinza) → William Candillon (wcandillon)
Revision history for this message
William Candillon (wcandillon) wrote :

Looks very good!
The error location is on the start tag vs the end tag but maybe it wouldn't make sense for other static error to have the query location there.

I got:
<test.xq>:3,1: static error [err:XPST0003]: invalid expression: syntax error, end tag </foo> does not match start tag <bar>
I was excepting:
<test.xq>:4,1: static error [err:XPST0003]: invalid expression: syntax error, end tag </foo> does not match start tag <bar>

Please tell me what you think about the query location and I'll close the bug.

Revision history for this message
Chris Hillery (ceejatec) wrote :

Nicolae - is it possible to have the error location be on the end-tag, without affecting other error locations? If not, we'll call this "good enough".

Changed in zorba:
assignee: William Candillon (wcandillon) → Nicolae Brinza (nbrinza)
Revision history for this message
Chris Hillery (ceejatec) wrote :

(I am leaving this marked as targeted for 2.8, because if the current code is OK, it was fixed in 2.8)

Revision history for this message
Nicolae Brinza (nbrinza) wrote :

I have updated the location so now it points to the mismatched closing tag, i.e.:

<test.xq>:4,1: static error [err:XPST0003]: invalid expression: syntax error, end tag </foo> does not match start tag <bar>

Nicolae Brinza (nbrinza)
Changed in zorba:
status: New → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
milestone: 2.8 → 2.9
Chris Hillery (ceejatec)
tags: removed: parser-normalization
tags: removed: v2.1
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.

Other bug subscribers

Remote bug watches

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