Replace fold/unfold intentions with a set of specialized ones

This commit is contained in:
Alexey Sedunov
2013-04-16 14:33:58 +04:00
parent 9e441b0525
commit 64e578297c
113 changed files with 972 additions and 437 deletions
@@ -0,0 +1,21 @@
fun test(n: Int): String {
var res: String
if (n == 1) {
<caret>if (3 > 2) {
println("***")
res = "one"
} else {
println("***")
res = "???"
}
} else if (n == 2) {
println("***")
res = "two"
} else {
println("***")
res = "too many"
}
return res
}
@@ -0,0 +1,21 @@
fun test(n: Int): String {
var res: String
if (n == 1) {
<caret>res = if (3 > 2) {
println("***")
"one"
} else {
println("***")
"???"
}
} else if (n == 2) {
println("***")
res = "two"
} else {
println("***")
res = "too many"
}
return res
}
@@ -0,0 +1,7 @@
fun test(n: Int): String {
var res: String
<caret>if (n == 1) res = "one" else res = "two"
return res
}
@@ -0,0 +1,7 @@
fun test(n: Int): String {
var res: String
<caret>res = if (n == 1) "one" else "two"
return res
}
@@ -0,0 +1,7 @@
fun test(n: Int): String {
var res: String = "!"
<caret>if (n == 1) res += "one" else res += "two"
return res
}
@@ -0,0 +1,7 @@
fun test(n: Int): String {
var res: String = "!"
<caret>res += if (n == 1) "one" else "two"
return res
}
@@ -0,0 +1,13 @@
fun test(n: Int): String {
var res: String
<caret>if (n == 1) {
println("***")
res = "one"
} else {
println("***")
res = "two"
}
return res
}
@@ -0,0 +1,13 @@
fun test(n: Int): String {
var res: String
<caret>res = if (n == 1) {
println("***")
"one"
} else {
println("***")
"two"
}
return res
}
@@ -0,0 +1,16 @@
// IS_APPLICABLE: false
fun test(n: Int): String {
var res: String = ""
<caret>if (n == 1) {
println("***")
res = "one"
} else {
var res: String
println("***")
res = "two"
}
return res
}
@@ -0,0 +1,12 @@
// IS_APPLICABLE: false
fun test(s: String): Int {
var n: Int = 1;
<caret>if (s.equals("add")) {
n += 1
} else {
n -= 1
}
return n
}
@@ -0,0 +1,13 @@
// IS_APPLICABLE: false
fun test(n: Int): String {
var res: String = ""
var res2: String = ""
<caret>if (n == 1) {
res = "one"
} else {
res2 = "two"
}
return res + res2
}
@@ -0,0 +1,11 @@
// IS_APPLICABLE: false
fun test(n: Int): String {
var res: String = ""
<caret>if (n == 1) {
println("***")
res = "one"
}
return res
}
@@ -0,0 +1,14 @@
// IS_APPLICABLE: false
fun test(n: Int): String {
var res: String
<caret>if (n == 1) {
res = "one"
println("***")
} else {
println("***")
res = "two"
}
return res
}