com.lightningkite.khrysalis.util.StringChain.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-compiler-plugin-common Show documentation
Show all versions of kotlin-compiler-plugin-common Show documentation
Common translational tools between Typescript and Swift.
The newest version!
package com.lightningkite.khrysalis.util
interface Appending {
fun appendTo(appendable: Appendable)
}
fun Appendable.appendPlus(part: Any){
if(part is Appending) {
part.appendTo(this)
} else {
append(part.toString())
}
}
class AppendingChain(val parts: ArrayList): Appending {
override fun toString(): String = buildString {
for(part in parts){
append(part)
}
}
override fun appendTo(appendable: Appendable) {
for(part in parts){
appendable.appendPlus(part)
}
}
}
/*
fun KtClass.swift(out: Out) {
when {
x -> { swiftEnum(); return }
y -> { swiftDataClass(); return }
}
out.appendln(name)
out.appendln("{")
}
*/
© 2015 - 2024 Weber Informatics LLC | Privacy Policy