parseFile

fun parseFile(code: String, path: String = "temp.kt", throwOnError: Boolean = true): Node.KotlinFile

Parses Kotlin source code into AST.

Return

AST node that represents the Kotlin file

Parameters

code

Kotlin source code

throwOnError

whether to throw an exception if there are errors

path

path of the file