Skip to content

Instantly share code, notes, and snippets.

Robert Ekendahl rekendahl

View GitHub Profile
rekendahl / scratch.kt
Created Nov 3, 2017
Kotlin list merge example
View scratch.kt
if (defines[macroName]?.body?.isNotEmpty() == true) {
val mergedList = mutableListOf<Pair<IElementType?, String?>>()
for (tokenInfo in defines[macroName]?.body.orEmpty()) {
val tokenType = tokenInfo.first
val tokenName = tokenInfo.second
when (tokenType) {
val lastToken = mergedList.last()
val nextToken = defines[macroName]?.body?.iterator()?.next()
You can’t perform that action at this time.