Formatter: support "else on new line" option

This commit is contained in:
Pavel V. Talanov
2014-01-17 18:34:43 +04:00
parent 97487e7238
commit 5caabc20f6
9 changed files with 122 additions and 16 deletions
@@ -0,0 +1,28 @@
fun f() {
if (true) {
} else if (true) {
} else {
}
if (true) {
} else if (true) {
} else {
}
if (a) 3 else 4
if (a) 5
else 5
if (a) 5
else
5
if (a)
5
else
5
}
// SET_TRUE: ELSE_ON_NEW_LINE
@@ -0,0 +1,32 @@
fun f() {
if (true) {
}
else if (true) {
}
else {
}
if (true) {
}
else if (true) {
}
else {
}
if (a) 3 else 4
if (a) 5
else 5
if (a) 5
else
5
if (a)
5
else
5
}
// SET_TRUE: ELSE_ON_NEW_LINE
+30
View File
@@ -0,0 +1,30 @@
fun f() {
if (true) {
}
else if (true) {
}
else {
}
if (true) {
} else if (true) {
} else {
}
if (a) 3 else 4
if (a) 5
else 5
if (a) 5
else
5
if (a)
5
else
5
}
// SET_TRUE: ELSE_ON_NEW_LINE
+5 -9
View File
@@ -7,8 +7,11 @@ fun f() {
}
if (true) {
} else {
}
else {
if (true) {
} else {
}
if (true) {
@@ -20,14 +23,7 @@ fun f() {
}
if (true) {
}
else {
}
if (true) {
}
else
} else
3 > 2
if (true) (3) else (4)