compiler-plugin / arrow.meta.quotes.expression.expressionwithlabel.instanceexpressionwithlabel / ThisExpression

ThisExpression

class ThisExpression : InstanceExpressionWithLabel<KtThisExpression>

””“$instanceReference$targetLabel”””.this

A template destructuring Scope for a KtBreakExpression.

import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.thisExpression

val Meta.reformatThisExpression: CliPlugin
 get() =
  "ReformatThis" {
    meta(
      thisExpression({ true }) { instanceExpressionWithLabel ->
        Transform.replace(
          replacing = instanceExpressionWithLabel,
          newDeclaration = when {
            targetLabel.value != null -> """$instanceReference$targetLabel""".`this`
            else -> """$instanceReference""".`this`
          }
        )
      }
    )
  }

Constructors

<init> ””“$instanceReference$targetLabel”””.thisThisExpression(value: KtThisExpression, labelName: String? = value.getLabelName())

Properties

labelName val labelName: String?
value val value: KtThisExpression

Functions

identity fun ElementScope.identity(): ThisExpression

Extension Functions

map fun <K : KtElement> Scope<K>.map(f: (K) -> K): Scope<K>
orEmpty fun <K : KtElement> Scope<K>?.orEmpty(): Scope<K>

Do you like Arrow?

Arrow Org
<