[SIR, FIR generators] Add KDocs for visitor-related methods of elements
This commit is contained in:
committed by
Space Team
parent
1bed6a063f
commit
cab87eba21
@@ -39,6 +39,11 @@ sealed interface SirElement {
|
||||
fun <E : SirElement, D> transform(transformer: SirTransformer<D>, data: D): E =
|
||||
transformer.transformElement(this, data) as E
|
||||
|
||||
/**
|
||||
* Runs the provided [visitor] on the Swift IR subtree with the root at this node.
|
||||
*
|
||||
* @param visitor The visitor to accept.
|
||||
*/
|
||||
fun accept(visitor: SirVisitorVoid) = accept(visitor, null)
|
||||
|
||||
/**
|
||||
@@ -53,6 +58,15 @@ sealed interface SirElement {
|
||||
*/
|
||||
fun <R, D> acceptChildren(visitor: SirVisitor<R, D>, data: D)
|
||||
|
||||
/**
|
||||
* Runs the provided [visitor] on subtrees with roots in this node's children.
|
||||
*
|
||||
* Basically, calls `accept(visitor)` on each child of this node.
|
||||
*
|
||||
* Does **not** run [visitor] on this node itself.
|
||||
*
|
||||
* @param visitor The visitor for children to accept.
|
||||
*/
|
||||
fun acceptChildren(visitor: SirVisitorVoid) = acceptChildren(visitor, null)
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ internal class ElementPrinter(printer: SmartPrinter) : AbstractElementPrinter<El
|
||||
|
||||
if (element.isRootElement) {
|
||||
println()
|
||||
printAcceptVoidMethod(elementVisitorVoidType)
|
||||
printAcceptVoidMethod(elementVisitorVoidType, treeName)
|
||||
printAcceptChildrenMethod(element, elementVisitorType, TypeVariable("R"))
|
||||
println()
|
||||
println()
|
||||
|
||||
Reference in New Issue
Block a user