Opened 15 years ago
Closed 12 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)
Change History (9)
comment:1 by , 12 years ago
| Component: | → OMEdit |
|---|---|
| Milestone: | → Future |
| Owner: | changed from to |
| Status: | new → assigned |
comment:2 by , 12 years ago
| Milestone: | Future → 1.9.0 |
|---|
comment:3 by , 12 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 , 12 years ago
comment:4 by , 12 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 , 12 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 , 12 years ago
The result view still lists the name of the variable as \\\" instead of " :)
comment:8 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |

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