compiler-plugin / arrow.meta.quotes.expression.expressionwithlabel / BreakExpression

BreakExpression

class BreakExpression : ExpressionWithLabel<KtBreakExpression>

”"”break$targetLabel”””.break

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.breakExpression

val Meta.reformatBreak: CliPlugin
   get() =
     "Reformat Break Expression" {
       meta(
         breakExpression({ true }) { expressionWithLabel ->
           Transform.replace(
             replacing = expressionWithLabel,
             newDeclaration = """break$targetLabel""".`break`
           )
         }
       )
     }

Constructors

<init> ”"”break$targetLabel”””.breakBreakExpression(value: KtBreakExpression, targetLabel: Scope<KtSimpleNameExpression> = Scope(value.getTargetLabel()), labelName: String? = value.getLabelName() ?: "break")

Properties

labelName val labelName: String?
targetLabel val targetLabel: Scope<KtSimpleNameExpression>
value val value: KtBreakExpression

Functions

identity fun ElementScope.identity(): BreakExpression

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
<