[Bug 1015] New: Scripting incorrectly processes complex conditional in while() statement

http://bugs.orocos.org/show_bug.cgi?id=1015

Summary: Scripting incorrectly processes complex conditional in
while() statement
Product: RTT
Version: 1.10.3
Platform: All
OS/Version: GNU/Linux
Status: NEW
Severity: normal
Priority: P3
Component: Scripting
AssignedTo: orocos-dev [..] ...
ReportedBy: kiwi [dot] net [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

This works in a v1 Orocos RTT script (part of a .ops file):
{{{
var bool timedOut = false;
var bool finished = false;
// a bug in RTT means that if you put the "finished" condition in the
// "while" directly, it doesn't work. Using the variable does work.
while !finished && !timedOut
{
do nothing;
try logInfo(rt_string("Waiting ..."));
set waited = waited + getPeriod();
set timedOut = (waited > maxWait);
set finished = RobotCommands.Sender.inFinalState() &&
RobotTelemetry.Sender.inFinalState() &&
!isRobotInitialized.Get();
}
}}}

The following fails. It appears to just pick up the robotInitialized bit, and
not wait for the state machines ("Sender") in the two RobotXXX peer components.
I tried various orderings of the conditional parts.
{{{
var bool timedOut = false;
while !RobotCommands.Sender.inFinalState() &&
!RobotTelemetry.Sender.inFinalState() &&
isRobotInitialized.Get &&
!timedOut
{
do nothing;
try logInfo(rt_string("Waiting ..."));
set waited = waited + getPeriod();
set timedOut = (waited > maxWait);
}
}}}

We suspect that this is likely a bug in the v2 Orocos scripting also.