Opened 18 years ago

Last modified 18 years ago

#74 closed defect (fixed)

elseif not recognized, ignored

Reported by: joer Owned by: joer
Priority: critical Milestone:
Component: Version:
Keywords: Cc: joer, adrpo

Description


Change History (2)

comment:1 Changed 18 years ago by joer

Create file elseif_err.mo:
model test

Real out1,out2,out3,out4;

equation

out1 = time;
out2 = (if time < 1 then time else time3);
out3 = (if time < 1 then time else if time < 2 then time
2 else time3);
out4 = (if time < 1 then time elseif time < 2 then time
2 else time3);

end test;

Using the latest (1.4) version of omc:
$ omc elseif_err.mo
fclass test
Real out1;
Real out2;
Real out3;
Real out4;
equation

out1 = time;
out2 = if time < 1.0 then time else time 3.0;
out3 = if time < 1.0 then time else if time < 2.0 then time
2.0 else time 3.0;
out4 = if time < 1.0 then time else time
3.0;

end test;

Note the difference between out3 and out4, they should be identical.

comment:2 Changed 18 years ago by adrpo

fixed in subversion revision 2517. also added a test in the testsuite in
revision 2518.
implemented elseif within if expression by constructing
IFEXPs within else part.

Note: See TracTickets for help on using tickets.