Uast: Support Kotlin anonymous initializers

This commit is contained in:
Yan Zhulanow
2016-03-10 18:14:39 +03:00
parent 335712141d
commit f1e5c85ba3
7 changed files with 98 additions and 6 deletions
@@ -47,7 +47,7 @@ interface UFunction : UDeclaration, UModifierOwner, UAnnotated {
return "${visibility.name} fun " + typeParameters + name + "(" + valueParameters + ")" + returnType + body
}
override fun logString() = "UFunction ($name, kind = ${kind.name}, " +
override fun logString() = "UFunction ($name, kind = ${kind.text}, " +
"paramCount = $valueParameterCount)\n" + body.logString().withMargin
}
@@ -15,15 +15,14 @@
*/
package org.jetbrains.uast
class UastFunctionKind(val name: String) {
open class UastFunctionKind(val text: String) {
class UastInitializerKind(val name: String) : UastFunctionKind("INITIALIZER ($name)")
companion object {
@JvmField
val FUNCTION = UastFunctionKind("function")
@JvmField
val CONSTRUCTOR = UastFunctionKind("CONSTRUCTOR")
@JvmField
val INITIALIZER = UastFunctionKind("INITIALIZER")
}
}