We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edf0a51 commit b9415cdCopy full SHA for b9415cd
java2python/lib/walker.g
@@ -366,6 +366,7 @@ statement [block]
366
| {
367
block.addComment("for-while")
368
for_init, for_stat = block.newFor()
369
+ for_iter = None
370
}
371
#("for"
372
#(FOR_INIT
@@ -376,7 +377,8 @@ statement [block]
376
377
)
378
{
379
for_stat.setExpression(("%s", for_cond))
- for_stat.addSource(("%s", for_iter))
380
+ if for_iter:
381
+ for_stat.addSource(("%s", for_iter))
382
383
384
java2python/tests/Loops.java
@@ -0,0 +1,13 @@
1
+class Loops {
2
+ public static void main(String[] args) {
3
+ for(int a = 1; a < 10;){
4
+ a+= 3;
5
+ System.out.println(a);
6
+ }
7
+
8
+ for (int b = 0; b < 20; b+=2) {
9
10
11
12
+}
13
0 commit comments