[IR] Add a kDoc for IrStringConcatenation

This commit is contained in:
Sergej Jaskiewicz
2023-11-28 16:31:10 +01:00
committed by Space Team
parent 2f98b4310a
commit 11d203d0a7
2 changed files with 23 additions and 1 deletions
@@ -13,7 +13,16 @@ import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
/**
* A leaf IR tree element.
* Represents a string template expression.
*
* For example, the value of `template` in the following code:
* ```kotlin
* val i = 10
* val template = "i = $i"
* ```
* will be represented by [IrStringConcatenation] with the following list of [arguments]:
* - [IrConst] whose `value` is `"i = "`
* - [IrGetValue] whose `symbol` will be that of the `i` variable.
*
* Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.stringConcatenation]
*/
@@ -1102,6 +1102,19 @@ object IrTree : AbstractTreeBuilder() {
val stringConcatenation: Element by element(Expression) {
parent(expression)
kDoc = """
Represents a string template expression.
For example, the value of `template` in the following code:
```kotlin
val i = 10
val template = "i = ${'$'}i"
```
will be represented by [${typeName}] with the following list of [arguments]:
- [${const.typeName}] whose `value` is `"i = "`
- [${getValue.typeName}] whose `symbol` will be that of the `i` variable.
""".trimIndent()
+listField("arguments", expression, mutability = MutableList)
}
val suspensionPoint: Element by element(Expression) {