bobjervis / parasol

The Parasol Language and related core development tools
Apache License 2.0
2 stars 2 forks source link

Vector expressions with embedded assignments do not work correctly. #16

Open bobjervis opened 9 years ago

bobjervis commented 9 years ago

Essentially, when re-sizing vector arguments to produce 'squared' results, the current code looks at all operands to set the resulting sizes of all assignments. However, this isn't quite correct:

int[] a, b, c, d, e;

a = b + (c = d * e);

In this case, the size of a depends on b, d and e, but the size of c only depends d and e. Code must account for nested assignments.

Of course, multiple-assignments do not require this complexity:

a = b = c = d + e;

Here, a, b and c all have the same output size because this is a simple multi-assignment case.