fix bug 420

This commit is contained in:
jdf
2010-10-26 02:34:13 +00:00
parent ff150a1d97
commit 6833df5a80
4 changed files with 15 additions and 1 deletions

View File

@@ -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;

View 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
View File

@@ -0,0 +1,2 @@
int[] a = new int[] { 1,2,3,4,5 };
for (int i: a) { print(i);}

View File

@@ -42,4 +42,9 @@ public class AutoFormatTests {
public void bug109() {
expectGood("bug109");
}
@Test
public void bug420() {
expectGood("bug420");
}
}