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

IsExpression

class IsExpression : Scope<KtIsExpression>

””“$left $operation $type”””.is

A template destructuring Scope for a KtIsExpression.

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

val Meta.reformatIs: CliPlugin
   get() =
     "Reformat Is Expression" {
       meta(
         isExpression({ true }) { expression ->
           Transform.replace(
             replacing = expression,
             newDeclaration = """$left $operation $type""".`is`
           )
         }
       )
     }

Constructors

<init> ””“$left $operation $type”””.isIsExpression(value: KtIsExpression?, left: Scope<KtExpression> = Scope(value?.leftHandSide), operation: Scope<KtSimpleNameExpression> = Scope(value?.operationReference), type: TypeReference = TypeReference(value?.typeReference))

Properties

left val left: Scope<KtExpression>
operation val operation: Scope<KtSimpleNameExpression>
type val type: TypeReference
value val value: KtIsExpression?

Functions

identity fun ElementScope.identity(): IsExpression

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
<