ros-infrastructure / catkin_pkg

Standalone Python library for the catkin build system.
https://github.com/ros/catkin
Other
47 stars 89 forks source link

Logical operators require parentheses around operands #277

Closed jacobperron closed 4 years ago

jacobperron commented 4 years ago

Once we get to three or more logical operators, the evaluation fails due to an assertion here:

https://github.com/ros-infrastructure/catkin_pkg/blob/27013d87262bef0d6ac7b9642aa4ed18d9ce21cd/src/catkin_pkg/condition.py#L61

Example input:

<depend condition="$FOO != ON and $FOO != 1 and $FOO != true">

If we add parentheses, then the expression evaluates correctly:

<depend condition="($FOO != ON and $FOO != 1) and $FOO != true">

I would think that the expression without parenthesis should work fine (as it would in a programming language).