Projections & Initial grammar
This commit is contained in:
Generated
+1
@@ -3,6 +3,7 @@
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/examples.iml" filepath="$PROJECT_DIR$/examples.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/../grammar/grammar.iml" filepath="$PROJECT_DIR$/../grammar/grammar.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
@@ -2,16 +2,16 @@ interface class IIterator<out T> {
|
||||
fun next() : T
|
||||
val hasNext : Boolean
|
||||
|
||||
fun toArray(buffer : WriteOnlyArray<T>) : Int { // T is still an in-parameter
|
||||
fun toArray(buffer : MutableArray<in T>) : Int { // T is still an in-parameter
|
||||
return fillBuffer(buffer, 0, buffer.size)
|
||||
}
|
||||
|
||||
fun toArray(buffer : WriteOnlyArray<T>, from : Int, length : Int) : Int { // T is still an in-parameter
|
||||
fun toArray(buffer : MutableArray<in T>, from : Int, length : Int) : Int { // T is still an in-parameter
|
||||
if (from < 0 || from > buffer.lastIndex || length < 0 || length > buffer.size - from) {
|
||||
throw IndexOutOfBoundsException();
|
||||
}
|
||||
|
||||
if (len == 0) return 0;
|
||||
if (len == 0) return 0
|
||||
|
||||
var count = 0;
|
||||
for (i in [from .. from + length - 1]) {
|
||||
|
||||
Reference in New Issue
Block a user