Skip to content

Instantly share code, notes, and snippets.

@suhininalex
Created February 8, 2017 09:47
Show Gist options
  • Save suhininalex/06af5c1d744877c153dbe5105f01b379 to your computer and use it in GitHub Desktop.
Save suhininalex/06af5c1d744877c153dbe5105f01b379 to your computer and use it in GitHub Desktop.
var leftPsi: PsiElement? = clone.firstPsi
val result = generateSequence (clone.firstPsi) { it.findNextSibling(end) }
.filter { ! it.haveSibling(end) }
.map {
val result = leftPsi!! to it
leftPsi = it.findNextSibling(end)
result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment