Skip to content

Instantly share code, notes, and snippets.

:bowtie:

Robert Ekendahl rekendahl

:bowtie:
Block or report user

Report or block rekendahl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rekendahl
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) {
CD_TICK_TICK -> {
val lastToken = mergedList.last()
mergedList.remove(lastToken)
val nextToken = defines[macroName]?.body?.iterator()?.next()
You can’t perform that action at this time.