History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-3779
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P2 P2
Assignee: Mamye Kratt
Reporter: notzippy
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Misleading Compilation exception syntax error

Created: 24/Mar/07 01:53 PM   Updated: 27/Sep/07 08:56 AM
Component/s: Compiler
Affects Version/s: 3.4, 3.3.3, 4.0.0
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

Environment: WinXP

Severity: Minor
Fixed in Change#: 4,515
Runtime: N/A
Fix in hand: False


 Description  « Hide
When the following code is compiled it produces a misleading error message
<clas name="foo">
       <attribute name="currenttid" type="number" value=""/>
... // More code
</class>

The message is (Note the line number is also incorrect when being reported
tims.lzx:72:16: Syntax error: the token "," was not expected at this position.

A nicer error would be:
tims.lzx:23:58: Attributes' value is invalid

Also it would be nice if the line number was correct.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Philip Romanik - 27/Mar/07 07:39 AM
The first line of the sample code,

<clas name="foo">

is not the error. I think it is just a typo. This is the version I used to test the changeset:

<canvas>
<class name="foo">
       <attribute name="currenttid" type="number" value=""/>
</class>
<foo/>
</canvas>

notzippy - 27/Mar/07 07:54 AM
Quite correct, sorry about that..

P T Withington - 27/Mar/07 08:40 AM
r4515 | ptw | 2007-03-27 12:39:04 -0400 (Tue, 27 Mar 2007) | 23 lines
Changed paths:
   M /openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java

Change 20070327-ptw-0 by ptw@dueling-banjos.local on 2007-03-27 09:53:08 EDT
    in /Users/ptw/OpenLaszlo/legals-1/test
    for http://svn.openlaszlo.org/openlaszlo/branches/legals/test

Summary: NodeModel correctly annotates and delimits attribute values

Bugs Fixed:
LPP-3779 'Misleading Compilation exception syntax error'

Technical Reviewer: promanik (Message-Id: <6.2.1.2.0.20070327113647.02312770@na>)
QA Reviewer: mamye (pending)
Doc Reviewer: n/a

Details:
    NodeModel: Only pass attribute values straight through if the are
    Maps, thus all other attribute values will be annotated with
    source location and delimited so that a useful error can be
    generated by the parser.

Tests:
    Test case from bug report