Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3969 closed defect (fixed)

Line numbers of syntax errors are reported incorrectly in OMEdit

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: blocker Milestone:
Component: OMEdit Version:
Keywords: Cc:

Description

Open the attached test package with OMEdit and follow these steps:

  • Open packages P and then P.Q1 in the libraries browser
  • Select model P.Q2.M1
  • The model is shown correctly with the line numbering of the .mo file
  • Remove the semicolon after the declaration Real z;
  • Check the model

The following error shows up:

[P: 5:3-5:3]: Missing token: SEMICOLON

In fact, the error is found at line 35, not 5. It is true that the error is located in the fifth line displayed in the code window, but the error message should refer to the line numbering shown, which is relative to the .mo file, otherwise one has to count the lines manually.

If I click on the SEMICOLON link, I am brough to a view corresponding to the entire .mo file, line 5. Besides that being the wrong line, the code shown in this view still has the semicolon in the declaration of Real z;, which is inconsistent with the previous view, and it is impossible to fix the error from there, so the link is totally useless. In fact, it is misleading.

If I save the current view at this point, the net effect is to lose all changes, without any warning.

All things considered, the situation is quite confusing...

Please make sure that:

  • line numbers in error messages in the message browser are consistent to the line numbers shown in the source code window of the class being checked or compiled
  • clicking on the link in the error message brings to the error location in the same view from which the check or compile command was run, not to another view which still contains the previous syntactically correct version of the code

Attachments (1)

P.mo (879 bytes ) - added by Francesco Casella 9 years ago.

Download all attachments as: .zip

Change History (4)

by Francesco Casella, 9 years ago

Attachment: P.mo added

comment:1 by Francesco Casella, 9 years ago

Summary: Line numers of syntax error are reported incorrectly in OMEditLine numbers of syntax errors are reported incorrectly in OMEdit

comment:2 by Adeel Asghar, 9 years ago

Milestone: 2.0.01.10.0
Resolution: fixed
Status: newclosed

Fixed in 611bc0f/OMEdit.

comment:3 by Martin Sjölund, 7 years ago

Milestone: 1.10.0

Milestone deleted

Note: See TracTickets for help on using tickets.