Fix #214: Prevent scope change for function calls when optimising switches #216
A procedure call can use variables from current scope as call parameters.
Prevent this by considering procedure calls like any complex expression, and allow the switch to be rewritten.
And while I was updating a regression test, I decided to include string test for #205.
So, I managed to frankenstein this PR together with current master and PR #173, and it appears to work, so thanks for a quick fix
However if I write it similar to the way shown in the original issue, but with the 4th parameter simply empty brackets and the call as the return value...
...I don't get any syntax errors but nmlc still "optimises" the switch resulting in failure. I'm not really sure if this is even valid code, or related to this issue, but thought I should mention it.
This is with your fix applied, but also PR #173 applied as well (as I can't build without it). I'd have to build a special GRF to check your fix separately, but they don't seem to conflict here so not sure if that affects anything.
EDIT: Actually disregard that, I tested again and it is working after fixing a typo in my code, so it's all good