That's not what was asked..
+= increment before use
=+ increment after use
Etc.
++ and -- are already covered by for to and for downto.
Increment after use in your patch doesn't work. Not in
for to and not in
for downto.I reverted the patch.
Plz IF you create a compiler patch,
make sure it works AND fails as intended. In this case make sure it works like its C equivalent.
Make sure it can not overflow and underflow.
What is your intended code? I don't see the point with your patch. Examples? What works? I can only show it doesn't work:
// very basic fail:
var i:integer = 0;
begin
while i < 10 do
writeln(i++); // should be 0..9
i := 0;
while i < 10 do
writeln(++i); //should be 1..10
end.
And what is the equivalent for
for(i
=0;i
<10;i
++){printf("i");}; for(i
=0;i
<10;++i
){printf("i");};
Now please explain if your patch actually does
anything?.. useful...<grumpy...
>
The patch is harmless for one try if someone wants to test it, but revert it immediately after the test...
I did, see test code.
It is utter nonsense because it is not thought through and poorly implemented if at all sound.
More basic fail:
// very basic fail 2:
var i:integer = 0;
begin
while i++ < 10 do
writeln(i); // should be 0..9
i := 0;
while ++i < 10 do
writeln(i); //should be 1..9! // 9 not 10
end.
Does not work, does it?
Mind you, I want all of this to work, but it is far more complex to implement than your try and than you think. Try again....