generate more methods and properties in the standard library

This commit is contained in:
Dmitry Jemerov
2015-02-10 14:31:20 +01:00
parent 7827bbf64b
commit 4352023d60
8 changed files with 449 additions and 198 deletions
@@ -23,5 +23,23 @@ fun arrays(): List<GenericFunction> {
}
}
templates add pval("lastIndex") {
only(ArraysOfObjects, ArraysOfPrimitives)
doc { "Returns the last valid index for the array" }
returns("Int")
body {
"get() = size - 1"
}
}
templates add pval("indices") {
only(ArraysOfObjects, ArraysOfPrimitives)
doc { "Returns the range of valid indices for the array" }
returns("IntRange")
body {
"get() = IntRange(0, lastIndex)"
}
}
return templates
}