Revision 17460 says this:
---
Add Java-style "for" loop:
for (INIT [, INIT]* ; CONDITION ; ITERATE [, ITERATE]* ) BODY
You can have 0 or more INIT statements, which can be of the form
X = EXP (where X is declared already) or
TYPE X = EXP (where X of type TYPE will be declared in the BODY scope).
You can have 0 or more ITERATE statements, which can be of the form
X++ or X--
++X or --X
X OPER EXP (where OPER can be =, +=, -=, etc.
BODY can be a single statement ending with a ; or a block enclosed in {}, with no ; at the end, just like any loop.
break, continue, return, or exit are allowed within BODY, just like any loop.
---
I just realized that I forgot to say that CONDITION is a boolean expression. I also realized that I probably did not allow you to omit it, which would default to "true". I'll fix that by and by.
I did a fair amount of whackage elsewhere in the parser - mostly adding types to various collection objects - so it is possible I broke something. Let me know ASAP if you see any issues.
And let me know if the new-style for loop works as you expect.
---
Add Java-style "for" loop:
for (INIT [, INIT]* ; CONDITION ; ITERATE [, ITERATE]* ) BODY
You can have 0 or more INIT statements, which can be of the form
X = EXP (where X is declared already) or
TYPE X = EXP (where X of type TYPE will be declared in the BODY scope).
You can have 0 or more ITERATE statements, which can be of the form
X++ or X--
++X or --X
X OPER EXP (where OPER can be =, +=, -=, etc.
BODY can be a single statement ending with a ; or a block enclosed in {}, with no ; at the end, just like any loop.
break, continue, return, or exit are allowed within BODY, just like any loop.
---
I just realized that I forgot to say that CONDITION is a boolean expression. I also realized that I probably did not allow you to omit it, which would default to "true". I'll fix that by and by.
I did a fair amount of whackage elsewhere in the parser - mostly adding types to various collection objects - so it is possible I broke something. Let me know ASAP if you see any issues.
And let me know if the new-style for loop works as you expect.