mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
fix bug 420
This commit is contained in:
@@ -327,6 +327,7 @@ public class AutoFormat {
|
||||
case ',':
|
||||
trimRight(buf);
|
||||
buf.append(c);
|
||||
buf.append(' ');
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
@@ -581,7 +582,7 @@ public class AutoFormat {
|
||||
|
||||
if ((lookup("for"))) {
|
||||
c = get_string();
|
||||
while (c != ';') {
|
||||
while (c != ';' && c != ':') {
|
||||
c = get_string();
|
||||
}
|
||||
ct = 0;
|
||||
|
||||
6
app/test/resources/bug420.expected
Executable file
6
app/test/resources/bug420.expected
Executable file
@@ -0,0 +1,6 @@
|
||||
int[] a = new int[] {
|
||||
1, 2, 3, 4, 5
|
||||
};
|
||||
for (int i: a) {
|
||||
print(i);
|
||||
}
|
||||
2
app/test/resources/bug420.pde
Executable file
2
app/test/resources/bug420.pde
Executable file
@@ -0,0 +1,2 @@
|
||||
int[] a = new int[] { 1,2,3,4,5 };
|
||||
for (int i: a) { print(i);}
|
||||
@@ -42,4 +42,9 @@ public class AutoFormatTests {
|
||||
public void bug109() {
|
||||
expectGood("bug109");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bug420() {
|
||||
expectGood("bug420");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user