You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Daniel Sun <re...@hotmail.com> on 2017/01/28 13:57:16 UTC

Standard "for" loop statement for Groovy 3

Hi all,

      The new parser Parrot supports standard "for" loop
statement(conforming to JLS) now, e.g.
1) for (int i = 0, n = 10; i < n; i++) {..}
2) for(int i = 0, j = 10; i < j; i++, j--) {..}

       More examples:
1)
https://github.com/danielsun1106/groovy-parser/blob/master/src/test/resources/core/For_04x.groovy
2)
https://github.com/danielsun1106/groovy-parser/blob/master/src/test/resources/core/For_05x.groovy

PS: I've studied and used Groovy since the end of 2006, the standard "for"
loop statement has been the feature I mostly wanted. I'm really glad to
introduce it into the Groovy 3 :)

Cheers,
Daniel.Sun



--
View this message in context: http://groovy.329449.n5.nabble.com/Standard-for-loop-statement-for-Groovy-3-tp5738199.html
Sent from the Groovy Dev mailing list archive at Nabble.com.

Re: Standard "for" loop statement for Groovy 3

Posted by Daniel Sun <re...@hotmail.com>.
BTW, the old parser just supports limited "for" loop statement, e.g. for (int
i = 0; i < 10; i++) {..}

Cheers,
Daniel.Sun



--
View this message in context: http://groovy.329449.n5.nabble.com/Standard-for-loop-statement-for-Groovy-3-tp5738199p5738200.html
Sent from the Groovy Dev mailing list archive at Nabble.com.