|
58 | 58 | on the second line of its value.
|
59 | 59 | ```
|
60 | 60 |
|
| 61 | + - Introduce parameterized `Terms`. (#176) |
| 62 | +
|
| 63 | + References to `Terms` can now receive parameters which will be used by |
| 64 | + the runtime as values of variables referenced from within the `Term`. |
| 65 | + This allows `Terms` to use regular `Patterns` as values, rather than |
| 66 | + `VariantLists`: |
| 67 | +
|
| 68 | + ```properties |
| 69 | + # A Term with a VariantList as a value. |
| 70 | + -thing = { |
| 71 | + *[definite] the thing |
| 72 | + *[indefinite] a thing |
| 73 | + } |
| 74 | +
|
| 75 | + this = This is { -term[indefinite] }. |
| 76 | + ``` |
| 77 | +
|
| 78 | + ```properties |
| 79 | + # A parametrized Term with a Pattern as a value. |
| 80 | + -thing = { $article -> |
| 81 | + *[definite] the thing |
| 82 | + *[indefinite] a thing |
| 83 | + } |
| 84 | +
|
| 85 | + this = This is { -thing(article: "indefinite") }. |
| 86 | + ``` |
| 87 | +
|
| 88 | + Since `Patterns` can be nested, this feature allows more complex |
| 89 | + hierarchies of term values: |
| 90 | +
|
| 91 | + ```properties |
| 92 | + # A parametrized Term with nested Patterns. |
| 93 | + -thing = { $article -> |
| 94 | + *[definite] { $first-letter -> |
| 95 | + *[lower] the thing |
| 96 | + [upper] The thing |
| 97 | + } |
| 98 | + [indefinite] { $first-letter -> |
| 99 | + *[lower] a thing |
| 100 | + [upper] A thing |
| 101 | + } |
| 102 | + } |
| 103 | +
|
| 104 | + this = This is { -term(first-letter: "lower", article: "indefinite") }. |
| 105 | + ``` |
| 106 | +
|
| 107 | + Parameters must be named; positional parameters are ignored. If a |
| 108 | + parameter is omitted then the regular default variant logic applies. The |
| 109 | + above example could thus be written as `{-term(article: "indefinite")}` |
| 110 | + and the `lower` variant would be used because it is marked as the default |
| 111 | + one. If no parameters are specified, the paranthesis can be omitted: |
| 112 | + `{-term()}` and `{-term}` are functionally the same. |
| 113 | +
|
61 | 114 | - Support astral Unicode characters. (#174)
|
62 | 115 |
|
63 | 116 | Unicode characters from outside of the Basic Multilingual Plane can now
|
|
0 commit comments