Skip to content

Commit 7415f2d

Browse files
committed
Update CHANGELOG
1 parent 8fd18fe commit 7415f2d

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

spec/CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,59 @@
5858
on the second line of its value.
5959
```
6060
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+
61114
- Support astral Unicode characters. (#174)
62115
63116
Unicode characters from outside of the Basic Multilingual Plane can now

0 commit comments

Comments
 (0)