differentmatt / filbert

JavaScript parser of Python
Other
133 stars 27 forks source link

Single line while can't handle multiple statements #41

Open differentmatt opened 10 years ago

differentmatt commented 10 years ago

This is probably not limited to while loops.

Input:

total = 0
while True: total += 1; break;
print(total)

Output:

var total = 0;
while (true) {
    total = __pythonRuntime.ops.add(total, 1);
}
break;
;
__pythonRuntime.functions.print(total);