Converter:
Preserve white spaces inside code blocks Introduce WhiteSpaceSeparatedElementList which keeps track of whitespaces Introduce StatementList Change old test data accordingly
This commit is contained in:
committed by
Pavel V. Talanov
parent
fabfcb4271
commit
8577d3ca55
@@ -13,6 +13,7 @@ public class Test(str: String) {
|
||||
val test = "String2"
|
||||
sout(test)
|
||||
sout(dummy(test))
|
||||
|
||||
Test(test)
|
||||
}
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@ public open class Test(str: String) {
|
||||
var test: String = "String2"
|
||||
sout(test)
|
||||
sout(dummy(test))
|
||||
|
||||
Test(test)
|
||||
}
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ class User() {
|
||||
val lib = Library()
|
||||
lib.call()
|
||||
lib.getString().isEmpty()
|
||||
|
||||
Library().call()
|
||||
Library().getString().isEmpty()
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ open class User() {
|
||||
var lib: Library? = Library()
|
||||
lib?.call()
|
||||
lib?.getString()?.isEmpty()
|
||||
|
||||
Library().call()
|
||||
Library().getString()?.isEmpty()
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ class User() {
|
||||
fun main() {
|
||||
val m = HashMap(1)
|
||||
val m2 = HashMap(10)
|
||||
|
||||
val t1 = Test.init()
|
||||
val t2 = Test.init("")
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ open class User() {
|
||||
open fun main() {
|
||||
var m: HashMap<Any?, Any?>? = HashMap(1)
|
||||
var m2: HashMap<Any?, Any?>? = HashMap(10)
|
||||
|
||||
var t1: Test? = Test.init()
|
||||
var t2: Test? = Test.init("")
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ class Test() {
|
||||
fun test() {
|
||||
val b = 10
|
||||
putInt(b.toInt())
|
||||
|
||||
val b2 = 10
|
||||
putInt(b2.toInt())
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ open class Test() {
|
||||
open fun test() {
|
||||
var b: Byte = 10
|
||||
putInt(b.toInt())
|
||||
|
||||
var b2: Byte? = 10
|
||||
putInt(b2?.toInt())
|
||||
}
|
||||
|
||||
@@ -12,12 +12,15 @@ class Test() {
|
||||
fun test() {
|
||||
if (One.myContainer.myBoolean)
|
||||
System.out.println("Ok")
|
||||
|
||||
val s = (if (One.myContainer.myBoolean)
|
||||
"YES"
|
||||
else
|
||||
"NO")
|
||||
|
||||
while (One.myContainer.myBoolean)
|
||||
System.out.println("Ok")
|
||||
|
||||
do
|
||||
{
|
||||
System.out.println("Ok")
|
||||
|
||||
@@ -12,12 +12,15 @@ open class Test() {
|
||||
open fun test() {
|
||||
if (One.myContainer?.myBoolean!!)
|
||||
System.out?.println("Ok")
|
||||
|
||||
var s: String? = (if (One.myContainer?.myBoolean!!)
|
||||
"YES"
|
||||
else
|
||||
"NO")
|
||||
|
||||
while (One.myContainer?.myBoolean!!)
|
||||
System.out?.println("Ok")
|
||||
|
||||
do
|
||||
{
|
||||
System.out?.println("Ok")
|
||||
|
||||
@@ -8,6 +8,7 @@ class Test() {
|
||||
System.out.println(true or false)
|
||||
System.out.println(true xor false)
|
||||
System.out.println(!true)
|
||||
|
||||
System.out.println(true && false)
|
||||
System.out.println(true || false)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ open class Test() {
|
||||
System.out?.println(true or false)
|
||||
System.out?.println(true xor false)
|
||||
System.out?.println(!true)
|
||||
|
||||
System.out?.println(true && false)
|
||||
System.out?.println(true || false)
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ class Test() {
|
||||
val s3 = ""
|
||||
if (s1.isEmpty() && s2.isEmpty())
|
||||
return "OK"
|
||||
|
||||
if (s1.isEmpty() && s2.isEmpty() && s3.isEmpty())
|
||||
return "OOOK"
|
||||
|
||||
return ""
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,10 @@ open class Test() {
|
||||
var s3: String? = ""
|
||||
if (s1?.isEmpty()!! && s2?.isEmpty()!!)
|
||||
return "OK"
|
||||
|
||||
if (s1?.isEmpty()!! && s2?.isEmpty()!! && s3?.isEmpty()!!)
|
||||
return "OOOK"
|
||||
|
||||
return ""
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,10 @@ class Test() {
|
||||
fun test() {
|
||||
val name = "$$$$"
|
||||
name = name.replaceAll("\\$[0-9]+", "\\$")
|
||||
|
||||
val c = '$'
|
||||
System.out.println(c)
|
||||
|
||||
val C = '$'
|
||||
System.out.println(C)
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ open class Test() {
|
||||
open fun test() {
|
||||
var name: String? = "$$$$"
|
||||
name = name?.replaceAll("\\$[0-9]+", "\\$")
|
||||
|
||||
var c: Char = '$'
|
||||
System.out?.println(c)
|
||||
|
||||
var C: Char? = '$'
|
||||
System.out?.println(C)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ class Test() {
|
||||
val l1 = 10
|
||||
val d1 = 10.0
|
||||
val f1 = 10.0.toFloat()
|
||||
|
||||
val l2 = 10
|
||||
val d2 = 10.0
|
||||
val f2 = 10.0.toFloat()
|
||||
@@ -11,6 +12,7 @@ class Test() {
|
||||
val l1 = 10
|
||||
val d1 = 10.0
|
||||
val f1 = 10.0.toFloat()
|
||||
|
||||
val l2 = 10
|
||||
val d2 = 10.0
|
||||
val f2 = 10.0.toFloat()
|
||||
|
||||
@@ -3,6 +3,7 @@ open class Test() {
|
||||
var l1: Long = 10
|
||||
var d1: Double = 10.0
|
||||
var f1: Float = 10.0.toFloat()
|
||||
|
||||
var l2: Long = 10
|
||||
var d2: Double = 10.0
|
||||
var f2: Float = 10.0.toFloat()
|
||||
@@ -11,6 +12,7 @@ open class Test() {
|
||||
var l1: Long? = 10
|
||||
var d1: Double? = 10.0
|
||||
var f1: Float? = 10.0.toFloat()
|
||||
|
||||
var l2: Long? = 10
|
||||
var d2: Double? = 10.0
|
||||
var f2: Float? = 10.0.toFloat()
|
||||
|
||||
@@ -2,6 +2,7 @@ class Test() {
|
||||
fun test() {
|
||||
val t1 = true
|
||||
val t2 = true
|
||||
|
||||
val f1 = false
|
||||
val f2 = false
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ open class Test() {
|
||||
open fun test() {
|
||||
var t1: Boolean = true
|
||||
var t2: Boolean? = true
|
||||
|
||||
var f1: Boolean = false
|
||||
var f2: Boolean? = false
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
public class NonDefault() {
|
||||
class object {
|
||||
public fun main(args: Array<String>) {
|
||||
|
||||
val value = 3
|
||||
val valueString = ""
|
||||
when (value) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
public open class NonDefault() {
|
||||
class object {
|
||||
public open fun main(args: Array<String?>?) {
|
||||
|
||||
var value: Int = 3
|
||||
var valueString: String? = ""
|
||||
when (value) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package switch_demo
|
||||
public class SwitchDemo() {
|
||||
class object {
|
||||
public fun main(args: Array<String>) {
|
||||
|
||||
val month = 8
|
||||
val monthString: String
|
||||
when (month) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package switch_demo
|
||||
public open class SwitchDemo() {
|
||||
class object {
|
||||
public open fun main(args: Array<String?>?) {
|
||||
|
||||
var month: Int = 8
|
||||
var monthString: String?
|
||||
when (month) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
public class NonDefault() {
|
||||
class object {
|
||||
public fun main(args: Array<String>) {
|
||||
|
||||
val value = 3
|
||||
val valueString = ""
|
||||
when (value) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
public open class NonDefault() {
|
||||
class object {
|
||||
public open fun main(args: Array<String?>?) {
|
||||
|
||||
var value: Int = 3
|
||||
var valueString: String? = ""
|
||||
when (value) {
|
||||
|
||||
Reference in New Issue
Block a user