Skip to content

Parentheses omitted when IF THEN ELSE optimization is applied #152

@chrispcampbell

Description

@chrispcampbell

I found an issue with the IF THEN ELSE optimization that was implemented for #102. When the optimization is applied, the code gen failed to preserve the parentheses, which are sometimes critical.

Example that demonstrates the problem:

constant = 1 ~~|
a = IF THEN ELSE(constant, b + c, d - e) * 10 ~~|

In this case, SDE currently generates incorrect code:

_a = _b + _c * 10;

It should instead preserve the parentheses:

_a = (_b + _c) * 10;

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions