compiler-plugin / arrow.meta.quotes.expression.loopexpression / WhileExpression

WhileExpression

class WhileExpression : LoopExpression<KtWhileExpression>

”"”while ($condition) $body”””.while

A template destructuring Scope for a KtWhileExpression.

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

val Meta.reformatWhile: CliPlugin
   get() =
     "Reformat While Expression" {
       meta(
         whileExpression({ true }) { loopExpression ->
           Transform.replace(
             replacing = loopExpression,
             newDeclaration = """"while ($condition) $body""".`while`
           )
         }
       )
     }

Constructors

<init> ”"”while ($condition) $body”””.whileWhileExpression(value: KtWhileExpression, condition: Scope<KtExpression> = Scope(value.condition))

Properties

condition val condition: Scope<KtExpression>
value val value: KtWhileExpression

Functions

identity fun ElementScope.identity(): WhileExpression

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
<