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

ThrowExpression

class ThrowExpression : Scope<KtThrowExpression>

”"”throw $thrownExpression”””.throw

A template destructuring Scope for a KtThrowExpression.

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

val Meta.reformatThrow: CliPlugin
   get() =
     "Reformat Throw Expression" {
       meta(
         throwExpression({ true }) { expression ->
           Transform.replace(
             replacing = expression,
             newDeclaration = """throw $thrownExpression""".`throw`
           )
         }
       )
     }

Constructors

<init> ”"”throw $thrownExpression”””.throwThrowExpression(value: KtThrowExpression?, thrownExpression: Scope<KtExpression> = Scope(value?.thrownExpression))

Properties

thrownExpression val thrownExpression: Scope<KtExpression>
value val value: KtThrowExpression?

Functions

identity fun ElementScope.identity(): ThrowExpression

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
<