Implement general expresion remover

This commit is contained in:
Alexey Sedunov
2013-06-19 16:12:30 +04:00
parent 0b634cc918
commit d019c23395
15 changed files with 116 additions and 1 deletions
@@ -0,0 +1,10 @@
// OPTION: 0
fun foo(n : Int): Int {
<caret>if (n > 0) {
1
} else {
-1
}
return 0
}
@@ -0,0 +1,5 @@
// OPTION: 0
fun foo(n : Int): Int {<caret>
return 0
}
@@ -0,0 +1,9 @@
// OPTION: 3
fun foo(n : Int): Int {
return 10 +
<caret>if (n > 0) {
1
} else {
-1
}
}
@@ -0,0 +1,3 @@
// OPTION: 3
fun foo(n : Int): Int {
<caret>}
@@ -0,0 +1,8 @@
// OPTION: 3
fun foo(n : Int): Int {
return <caret>if (n > 0) {
1
} else {
-1
}
}
@@ -0,0 +1,3 @@
// OPTION: 3
fun foo(n : Int): Int {
<caret>}
@@ -0,0 +1,10 @@
// OPTION: 0
fun foo(n : Int): Int {
<caret>try {
n/0
} catch (e: Exception) {
-1
}
return 0
}
@@ -0,0 +1,5 @@
// OPTION: 0
fun foo(n : Int): Int {<caret>
return 0
}
@@ -0,0 +1,8 @@
// OPTION: 1
fun foo(n : Int): Int {
return <caret>try {
n/0
} catch (e: Exception) {
-1
}
}
@@ -0,0 +1,3 @@
// OPTION: 1
fun foo(n : Int): Int {
<caret>}