Opened 14 years ago

Closed 11 years ago

#1475 closed defect (fixed)

OMEdit: Fails to parse quoted variables

Reported by: Martin Sjölund Owned by: Adeel Asghar
Priority: high Milestone: 1.9.0
Component: OMEdit Version:
Keywords: Cc: Martin Sjölund, Adeel Asghar

Description

class A
  constant Real r[2,2] = {{1,2},{3,4}};
  Real r2[2,2];
  Real '"' = 2.5 "\"";
  Real ',' = 7.5;
algorithm 
  r2:=r;
end A;

Yes, I would like to name my characters quote and comma :)

Attachments (1)

A.mo (131 bytes ) - added by Adeel Asghar 11 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Martin Sjölund, 12 years ago

Component: OMEdit
Milestone: Future
Owner: changed from Martin Sjölund to Adeel Asghar
Status: newassigned

It now displays '\\\"', which is wrong.

comment:2 by Martin Sjölund, 12 years ago

Milestone: Future1.9.0

comment:3 by Adeel Asghar, 11 years ago

Are you sure you can load such file? I get the following error,

loadFile("C:/Users/adeas31/Desktop/A.mo")
false
[C:\Users\adeas31\Desktop\A.mo:4:9-4:9:writable] Error: Lexer got but failed to recognize the rest: '"' = 2.5 "\'

by Adeel Asghar, 11 years ago

Attachment: A.mo added

comment:4 by anonymous, 11 years ago

Use:

class A
  constant Real r[2,2] = {{1,2},{3,4}};
  Real r2[2,2];
  Real '\"' = 2.5 "\"";
  Real ',' = 7.5;
algorithm 
  r2:=r;
end A;

I recently made the parser not accept the original model because the Modelica grammar does not allow it.

comment:5 by Adeel Asghar, 11 years ago

This model works fine in OMEdit. I can load it without any problem.
Martin can you check it again with the latest version of OMEdit?

comment:6 by Martin Sjölund, 11 years ago

The result view still lists the name of the variable as \\\" instead of " :)

comment:7 by Adeel Asghar, 11 years ago

Fixed in r16729.

comment:8 by Martin Sjölund, 11 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.