Transform *Array.size to properties

This commit is contained in:
Denis Zharkov
2015-10-14 13:56:18 +03:00
parent b050324869
commit bd37a10677
38 changed files with 147 additions and 107 deletions
@@ -28,7 +28,7 @@ class GenerateArrayIterators(out: PrintWriter) : BuiltInsSourceGenerator(out) {
val s = kind.capitalized
out.println("private class Array${s}Iterator(private val array: ${s}Array) : ${s}Iterator() {")
out.println(" private var index = 0")
out.println(" override fun hasNext() = index < array.size()")
out.println(" override fun hasNext() = index < array.size")
out.println(" override fun next$s() = array[index++]")
out.println("}")
out.println()
@@ -39,7 +39,7 @@ class GenerateArrays(out: PrintWriter) : BuiltInsSourceGenerator(out) {
out.println(" public operator fun set(index: Int, value: $s): Unit")
out.println()
out.println(" /** Returns the number of elements in the array. */")
out.println(" public fun size(): Int")
out.println(" public val size: Int")
out.println()
out.println(" /** Creates an iterator over the elements of the array. */")
out.println(" public operator fun iterator(): ${s}Iterator")