KT-65741 Fix SIR visitor parameter name & fix typo
This commit is contained in:
committed by
Space Team
parent
d76a6d6a9c
commit
9d30fb1b1c
+1
-1
@@ -22,7 +22,7 @@ abstract class AbstractTransformerPrinter<Element : AbstractElement<Element, Fie
|
||||
override fun printMethodsForElement(element: Element) {
|
||||
printer.run {
|
||||
println()
|
||||
val elementParameterName = element.safeDecapitalizedName
|
||||
val elementParameterName = element.visitorParameterName
|
||||
if (element.isRootElement) {
|
||||
val elementTP = TypeVariable("E", listOf(element))
|
||||
printFunctionDeclaration(
|
||||
|
||||
@@ -47,8 +47,8 @@ abstract class SirTransformer<in D> : SirVisitor<SirElement, D>() {
|
||||
}
|
||||
|
||||
|
||||
open fun transformNamedDeclaration(namedDeclaration: SirNamedDeclaration, data: D): SirDeclaration {
|
||||
return transformDeclaration(namedDeclaration, data)
|
||||
open fun transformNamedDeclaration(declaration: SirNamedDeclaration, data: D): SirDeclaration {
|
||||
return transformDeclaration(declaration, data)
|
||||
}
|
||||
|
||||
final override fun visitNamedDeclaration(declaration: SirNamedDeclaration, data: D): SirDeclaration {
|
||||
|
||||
@@ -61,7 +61,7 @@ private fun render(
|
||||
attributes: List<Pair<String, Any?>> = emptyList(),
|
||||
children: List<SirElement> = emptyList(),
|
||||
): String {
|
||||
return "${base::class.simpleName}${attributes.renderAsAttributres()} ${children.renderAsChildren()}"
|
||||
return "${base::class.simpleName}${attributes.renderAsAttributes()} ${children.renderAsChildren()}"
|
||||
}
|
||||
|
||||
private fun List<SirElement>.renderAsChildren(): String {
|
||||
@@ -70,7 +70,7 @@ private fun List<SirElement>.renderAsChildren(): String {
|
||||
} ?: "{}"
|
||||
}
|
||||
|
||||
private fun List<Pair<String, Any?>>.renderAsAttributres(): String {
|
||||
private fun List<Pair<String, Any?>>.renderAsAttributes(): String {
|
||||
return this.takeIf { isNotEmpty() }?.joinToString(prefix = "(\n", separator = "\n", postfix = "\n)") {
|
||||
" ${it.first}: ${it.second}"
|
||||
} ?: "()"
|
||||
|
||||
Reference in New Issue
Block a user