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

BlockExpression

class BlockExpression : Scope<KtBlockExpression>

””“$statements””“.block

A template destructuring Scope for a KtBlockExpression.

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

val Meta.reformatBlock: CliPlugin
   get() =
     "Reformat Block Expression" {
       meta(
         blockExpression({ true }) { expression ->
           Transform.replace(
             replacing = expression,
      newDeclaration = """$statements""".block
     )
    }
   )
  }

Constructors

| <init> | “”“$statements””“.blockBlockExpression(value: KtBlockExpression?, statements: ScopedList<KtExpression> = ScopedList( separator = "\n", value = value?.statements.orEmpty() )) |

Properties

statements val statements: ScopedList<KtExpression>
value val value: KtBlockExpression?

Functions

identity fun ElementScope.identity(): BlockExpression

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
<