Skip to content

DescribeGrammar tildes

Viktor Chernev edited this page Nov 11, 2024 · 4 revisions

Tildes, aka “tilde inversions” or simply “inversions” are an alternative way to add data to an entry, without using decorators, as decorators are not convenient for long texts. To write a tilde inversion, simply put a tilde symbol ~ in front of the entry that you wish to invert. The inverted entry is no longer part of the production, but refers solely to the head of the production now.

What happens behind the scenes is that the inversion is added as a decorator to the item, with the tag of the inversion being the name of the decorator. (However, this is not fully implemented yet, and the tilde inversions are added as items at the moment, as a hack around. The feature will be implemented in the next releases)

The example below illustrate how to use inversions. In the first example, we use inversions to add shorter versions to some items in a list, including the head. In the second example, we achieve the same with decorators:

Example (tilde inversions):
example-tildes

Example (decorators):
example-decorators

Links

Next
Prev

Clone this wiki locally