Declarative Text Kit: Expression and Evaluation
![Teaser image](https://christiantietze.de/posts/2024/05/declarative-text-kit-expression-evaluation/2024-05-27_expression-tree.png)
In DeclarativeTextKit
, I found the abstraction of an “expression” in my vocabulary to represent the Domain-Specific Language’s instructions useful. Here is an example of a valid block of changes: This uses two kinds of Swift Result Builder to define the DSL’s grammar: The rules of the grammar are essentially this: