compiler-plugin / arrow.meta.quotes.expression / BinaryExpression

BinaryExpression

class BinaryExpression : Scope<KtBinaryExpression>

””“$left $operationReference $right””“.binaryExpression

A template destructuring Scope for a KtBinaryExpression.

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

val Meta.reformatBinary: CliPlugin
   get() =
     "Reformat Binary Expression" {
       meta(
         binaryExpression({ true }) { expression ->
           Transform.replace(
             replacing = expression,
             newDeclaration = """$left $operationReference $right""".binaryExpression
           )
         }
       )
     }

Constructors

<init> ””“$left $operationReference $right””“.binaryExpressionBinaryExpression(value: KtBinaryExpression, left: Scope<KtExpression>? = Scope(value.left), right: Scope<KtExpression>? = Scope(value.right), operationReference: Scope<KtOperationReferenceExpression>? = Scope(value.operationReference))

Properties

left val left: Scope<KtExpression>?
operationReference val operationReference: Scope<KtOperationReferenceExpression>?
right val right: Scope<KtExpression>?
value val value: KtBinaryExpression

Functions

identity fun ElementScope.identity(): BinaryExpression

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
<