Created
June 17, 2024 09:19
-
-
Save sasssass/f13f632e54a0534250890c50d938dd23 to your computer and use it in GitHub Desktop.
NodeProcessor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun generateFunction(): FunSpec { | |
val funBuilder = FunSpec.builder("testFunction") | |
funBuilder.addParameter("something", String::class.asTypeName()) | |
val code = buildString { | |
append("val somethingelse = something {\n") | |
append("}\n") | |
append("return somethingElse") | |
} | |
funBuilder.returns(String::class).addCode(code) | |
return funBuilder.build() | |
} | |
/** | |
* fun testFunction(something: String): String { | |
* val somethingelse = something | |
* return somethingelse | |
* } | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment