Skip to content

Commit ecb071c

Browse files
committed
Linkify "resolved value"
1 parent 94098ca commit ecb071c

File tree

5 files changed

+52
-52
lines changed

5 files changed

+52
-52
lines changed

spec/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ An **_<dfn>Unsupported Statement</dfn>_** error occurs when a message includes a
258258
### Bad Selector
259259
260260
A **_<dfn>Bad Selector</dfn>_** error occurs when a message includes a _selector_
261-
with a resolved value which does not support selection.
261+
with a _resolved value_ which does not support selection.
262262
263263
> For example, attempting to format this message
264264
> would result in a _Bad Selector_ error:

spec/formatting.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Formatting of a _message_ is defined by the following operations:
1616
with reference to the current _formatting context_.
1717
This can include multiple steps,
1818
such as looking up the value of a variable and calling formatting functions.
19-
The form of the resolved value is implementation defined and the
19+
The form of the _resolved value_ is implementation defined and the
2020
value might not be evaluated or formatted yet.
2121
However, it needs to be "formattable", i.e. it contains everything required
2222
by the eventual formatting.
@@ -47,7 +47,7 @@ Formatting of a _message_ is defined by the following operations:
4747
if the _message_ contains any _reserved statements_,
4848
emit an _Unsupported Statement_ error.
4949

50-
- **_<dfn>Formatting</dfn>_** takes the resolved values of the selected _pattern_,
50+
- **_<dfn>Formatting</dfn>_** takes the _resolved values_ of the selected _pattern_,
5151
and produces the formatted result for the _message_.
5252
Depending on the implementation, this result could be a single concatenated string,
5353
an array of objects, an attributed string, or some other locally appropriate data type.
@@ -96,20 +96,20 @@ This specification allows for the same value to be used for:
9696
To support this, the _**resolved value**_ of each _expression_
9797
is an implementation-dependent value that supports some or all of the above use cases.
9898

99-
In a _declaration_, the resolved value of the _expression_ is bound to a _variable_,
99+
In a _declaration_, the _resolved value_ of the _expression_ is bound to a _variable_,
100100
which is available for use by later _expressions_.
101101
Since a _variable_ can be referenced in different ways later,
102102
implementations SHOULD NOT immediately fully format the value for output.
103103

104104
In an _input-declaration_, the _variable_ operand of the _variable-expression_
105105
identifies not only the name of the external input value,
106-
but also the _variable_ to which the resolved value of the _variable-expression_ is bound.
106+
but also the _variable_ to which the _resolved value_ of the _variable-expression_ is bound.
107107

108-
In _selectors_, the resolved value of an _expression_ is used for _pattern selection_.
108+
In _selectors_, the _resolved value_ of an _expression_ is used for _pattern selection_.
109109

110-
In a _pattern_, the resolved value of an _expression_ or _markup_ is used in its _formatting_.
110+
In a _pattern_, the _resolved value_ of an _expression_ or _markup_ is used in its _formatting_.
111111

112-
The form that resolved values take is implementation-dependent,
112+
The form that _resolved values_ take is implementation-dependent,
113113
and different implementations MAY choose to perform different levels of resolution.
114114

115115
> While this specification does not require it,
@@ -133,7 +133,7 @@ and different implementations MAY choose to perform different levels of resoluti
133133
> - An _expression_ could be used as a _selector_ _expression_ if
134134
> calling the `selectKeys(keys)` method of its _resolved value_
135135
> did not throw an error.
136-
> - Using a _variable reference_, the resolved value of an _expression_
136+
> - Using a _variable reference_, the _resolved value_ of an _expression_
137137
> could be used as an _operand_ or _option_ value if
138138
> calling the `getValue()` method of its _resolved value_ did not throw an error.
139139
> In this use case, the `resolvedOptions()` method could also
@@ -155,20 +155,20 @@ _Markup_ is only used in _patterns_.
155155
156156
Depending on the presence or absence of a _variable_ or _literal_ operand
157157
and a _function_, _private-use annotation_, or _reserved annotation_,
158-
the resolved value of the _expression_ is determined as follows:
158+
the _resolved value_ of an _expression_ is determined as follows:
159159
160160
If the _expression_ contains a _reserved annotation_,
161161
an _Unsupported Expression_ error is emitted and
162-
a _fallback value_ is used as the resolved value of the _expression_.
162+
a _fallback value_ is used as the _resolved value_ of the _expression_.
163163
164164
Else, if the _expression_ contains a _private-use annotation_,
165-
its resolved value is defined according to the implementation's specification.
165+
its _resolved value_ is defined according to the implementation's specification.
166166
167167
Else, if the _expression_ contains an _annotation_,
168-
its resolved value is defined by _function resolution_.
168+
its _resolved value_ is defined by _function resolution_.
169169
170170
Else, if the _expression_ consists of a _variable_,
171-
its resolved value is defined by _variable resolution_.
171+
its _resolved value_ is defined by _variable resolution_.
172172
An implementation MAY perform additional processing
173173
when resolving the value of an _expression_
174174
that consists only of a _variable_.
@@ -187,9 +187,9 @@ that consists only of a _variable_.
187187
> the pattern included the function `:datetime` with some set of default options.
188188
189189
Else, the _expression_ consists of a _literal_.
190-
Its resolved value is defined by _literal resolution_.
190+
Its _resolved value_ is defined by _literal resolution_.
191191
192-
> **Note**
192+
> [!NOTE]
193193
> This means that a _literal_ value with no _annotation_
194194
> is always treated as a string.
195195
> To represent values that are not strings as a _literal_,
@@ -204,13 +204,13 @@ Its resolved value is defined by _literal resolution_.
204204
205205
### Literal Resolution
206206
207-
The resolved value of a _text_ or a _literal_ is
207+
The _resolved value_ of a _text_ or a _literal_ contains
208208
the character sequence of the _text_ or _literal_
209209
after any character escape has been converted to the escaped character.
210210
211211
When a _literal_ is used as an _operand_
212212
or on the right-hand side of an _option_,
213-
the formatting function MUST treat its resolved value the same
213+
the formatting function MUST treat its _resolved value_ the same
214214
whether its value was originally _quoted_ or _unquoted_.
215215
216216
> For example,
@@ -222,7 +222,7 @@ The resolution of a _text_ or _literal_ MUST resolve to a string.
222222
223223
To resolve the value of a _variable_,
224224
its _name_ is used to identify either a local variable or an input variable.
225-
If a _declaration_ exists for the _variable_, its resolved value is used.
225+
If a _declaration_ exists for the _variable_, its _resolved value_ is used.
226226
Otherwise, the _variable_ is an implicit reference to an input value,
227227
and its value is looked up from the _formatting context_ _input mapping_.
228228
@@ -254,11 +254,11 @@ the following steps are taken:
254254
255255
- The current _locale_.
256256
- The resolved mapping of _options_.
257-
- If the _expression_ includes an _operand_, its resolved value.
257+
- If the _expression_ includes an _operand_, its _resolved value_.
258258
259259
The form that resolved _operand_ and _option_ values take is implementation-defined.
260260
261-
A _declaration_ binds the resolved value of an _expression_
261+
A _declaration_ binds the _resolved value_ of an _expression_
262262
to a _variable_.
263263
Thus, the result of one _function_ is potentially the _operand_
264264
of another _function_,
@@ -269,7 +269,7 @@ the following steps are taken:
269269
.local $n1 = {$n :number maximumFractionDigits=3}
270270
```
271271
the value bound to `$n` is the
272-
resolved value used as the _operand_
272+
_resolved value_ used as the _operand_
273273
of the `:number` _function_
274274
when resolving the value of the _variable_ `$n1`.
275275

@@ -287,7 +287,7 @@ the following steps are taken:
287287
for implementations of functions
288288
such that `U` can be coerced to `T`.
289289
Implementations of a _function_ SHOULD emit a
290-
_Bad Operand_ error for _operands_ whose resolved value
290+
_Bad Operand_ error for _operands_ whose _resolved value_
291291
or type is not supported.
292292

293293
> [!NOTE]
@@ -351,7 +351,7 @@ the following steps are taken:
351351
_operand_ did not match that expected by the _function_,
352352
the _function_ might cause a _Bad Operand_ error to be emitted.
353353
354-
In all failure cases, use the _fallback value_ for the _expression_ as the resolved value.
354+
In all failure cases, use the _fallback value_ for the _expression_ as its _resolved value_.
355355
356356
#### Option Resolution
357357
@@ -361,7 +361,7 @@ For each _option_:
361361
362362
- Resolve the _identifier_ of the _option_.
363363
- If the _option_'s right-hand side successfully resolves to a value,
364-
bind the _identifier_ of the _option_ to the resolved value in the mapping.
364+
bind the _identifier_ of the _option_ to the _resolved value_ in the mapping.
365365
- Otherwise, bind the _identifier_ of the _option_ to an unresolved value in the mapping.
366366
Implementations MAY later remove this value before calling the _function_.
367367
(Note that an _Unresolved Variable_ error will have been emitted.)
@@ -374,7 +374,7 @@ This mapping can be empty.
374374
375375
Unlike _functions_, the resolution of _markup_ is not customizable.
376376
377-
The resolved value of _markup_ includes the following fields:
377+
The _resolved value_ of _markup_ includes the following fields:
378378
379379
- The type of the markup: open, standalone, or close
380380
- The _identifier_ of the _markup_
@@ -384,7 +384,7 @@ The resolution of _markup_ MUST always succeed.
384384
385385
### Fallback Resolution
386386
387-
A **_<dfn>fallback value</dfn>_** is the resolved value for an _expression_ that fails to resolve.
387+
A **_<dfn>fallback value</dfn>_** is the _resolved value_ for an _expression_ that fails to resolve.
388388
389389
An _expression_ fails to resolve when:
390390
@@ -547,17 +547,17 @@ or if this is not available or empty, the U+FFFD REPLACEMENT CHARACTER `�`.
547547
548548
First, resolve the values of each _selector_:
549549
550-
1. Let `res` be a new empty list of resolved values that support selection.
550+
1. Let `res` be a new empty list of _resolved values_ that support selection.
551551
1. For each _selector_ `sel`, in source order,
552-
1. Let `rv` be the resolved value of `sel`.
552+
1. Let `rv` be the _resolved value_ of `sel`.
553553
1. If selection is supported for `rv`:
554554
1. Append `rv` as the last element of the list `res`.
555555
1. Else:
556-
1. Let `nomatch` be a resolved value for which selection always fails.
556+
1. Let `nomatch` be a _resolved value_ for which selection always fails.
557557
1. Append `nomatch` as the last element of the list `res`.
558558
1. Emit a _Bad Selector_ error.
559559
560-
The form of the resolved values is determined by each implementation,
560+
The form of the _resolved values_ is determined by each implementation,
561561
along with the manner of determining their support for selection.
562562
563563
### Resolve Preferences
@@ -571,9 +571,9 @@ Next, using `res`, resolve the preferential order for all message keys:
571571
1. Let `key` be the `var` key at position `i`.
572572
1. If `key` is not the catch-all key `'*'`:
573573
1. Assert that `key` is a _literal_.
574-
1. Let `ks` be the resolved value of `key`.
574+
1. Let `ks` be the _resolved value_ of `key`.
575575
1. Append `ks` as the last element of the list `keys`.
576-
1. Let `rv` be the resolved value at index `i` of `res`.
576+
1. Let `rv` be the _resolved value_ at index `i` of `res`.
577577
1. Let `matches` be the result of calling the method MatchSelectorKeys(`rv`, `keys`)
578578
1. Append `matches` as the last element of the list `pref`.
579579
@@ -597,7 +597,7 @@ filter the list of _variants_ to the ones that match with some preference:
597597
1. If `key` is the catch-all key `'*'`:
598598
1. Continue the inner loop on `pref`.
599599
1. Assert that `key` is a _literal_.
600-
1. Let `ks` be the resolved value of `key`.
600+
1. Let `ks` be the _resolved value_ of `key`.
601601
1. Let `matches` be the list of strings at index `i` of `pref`.
602602
1. If `matches` includes `ks`:
603603
1. Continue the inner loop on `pref`.
@@ -623,7 +623,7 @@ Finally, sort the list of variants `vars` and select the _pattern_:
623623
1. Let `key` be the `tuple` _variant_ key at position `i`.
624624
1. If `key` is not the catch-all key `'*'`:
625625
1. Assert that `key` is a _literal_.
626-
1. Let `ks` be the resolved value of `key`.
626+
1. Let `ks` be the _resolved value_ of `key`.
627627
1. Let `matchpref` be the integer position of `ks` in `matches`.
628628
1. Set the `tuple` integer value as `matchpref`.
629629
1. Set `sortable` to be the result of calling the method `SortVariants(sortable)`.
@@ -769,7 +769,7 @@ one {{Category match for {$count}}}
769769
After _pattern selection_,
770770
each _text_ and _placeholder_ part of the selected _pattern_ is resolved and formatted.
771771
772-
Resolved values cannot always be formatted by a given implementation.
772+
_Resolved values_ cannot always be formatted by a given implementation.
773773
When such an error occurs during _formatting_,
774774
an implementation SHOULD emit an appropriate _Message Function Error_ and produce a
775775
_fallback value_ for the _placeholder_ that produced the error.
@@ -780,8 +780,8 @@ appropriate data type or structure. Some examples of these include:
780780
781781
- A single string concatenated from the parts of the resolved _pattern_.
782782
- A string with associated attributes for portions of its text.
783-
- A flat sequence of objects corresponding to each resolved value.
784-
- A hierarchical structure of objects that group spans of resolved values,
783+
- A flat sequence of objects corresponding to each _resolved value_.
784+
- A hierarchical structure of objects that group spans of _resolved values_,
785785
such as sequences delimited by _markup-open_ and _markup-close_ _placeholders_.
786786
787787
Implementations SHOULD provide _formatting_ result types that match user needs,
@@ -890,7 +890,7 @@ The _Default Bidi Strategy_ is defined as follows:
890890
These correspond to the message having left-to-right directionality,
891891
right-to-left directionality, and to the message's directionality not being known.
892892
1. For each _expression_ `exp` in _pattern_:
893-
1. Let `fmt` be the formatted string representation of the resolved value of `exp`.
893+
1. Let `fmt` be the formatted string representation of the _resolved value_ of `exp`.
894894
1. Let `dir` be the directionality of `fmt`,
895895
one of « `'LTR'`, `'RTL'`, `'unknown'` », with the same meanings as for `msgdir`.
896896
1. If `dir` is `'LTR'`:

spec/registry.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ The function `:string` has no options.
321321
#### Selection
322322
323323
When implementing [`MatchSelectorKeys(resolvedSelector, keys)`](/spec/formatting.md#resolve-preferences)
324-
where `resolvedSelector` is the resolved value of a _selector_ _expression_
324+
where `resolvedSelector` is the _resolved value_ of a _selector_ _expression_
325325
and `keys` is a list of strings,
326326
the `:string` selector performs as described below.
327327
@@ -357,7 +357,7 @@ the `:string` selector performs as described below.
357357
358358
#### Formatting
359359
360-
The `:string` function returns the string value of the resolved value of the _operand_.
360+
The `:string` function returns the string value of the _resolved value_ of the _operand_.
361361
362362
## Numeric Value Selection and Formatting
363363
@@ -646,7 +646,7 @@ such as the number of fraction, integer, or significant digits.
646646
647647
A "digit size option" is an _option_ value that the _function_ interprets
648648
as a small integer value greater than or equal to zero.
649-
Implementations MAY define an upper limit on the resolved value
649+
Implementations MAY define an upper limit on the _resolved value_
650650
of a digit size option option consistent with that implementation's practical limits.
651651
652652
In most cases, the value of a digit size option will be a string that
@@ -668,7 +668,7 @@ Number selection has three modes:
668668
or to ordinal rule categories if there is no explicit match
669669
670670
When implementing [`MatchSelectorKeys(resolvedSelector, keys)`](/spec/formatting.md#resolve-preferences)
671-
where `resolvedSelector` is the resolved value of a _selector_ _expression_
671+
where `resolvedSelector` is the _resolved value_ of a _selector_ _expression_
672672
and `keys` is a list of strings,
673673
numeric selectors perform as described below.
674674
@@ -708,7 +708,7 @@ If the option `select` is set to `ordinal`, selection should be based on CLDR pl
708708
of type `ordinal`. See [charts](https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html)
709709
for examples.
710710
711-
Apply the rules defined by CLDR to the resolved value of the operand and the function options,
711+
Apply the rules defined by CLDR to the _resolved value_ of the operand and the function options,
712712
and return the resulting keyword.
713713
If no rules match, return `other`.
714714
@@ -794,7 +794,7 @@ or can use a collection of _field options_ (but not both) to control the formatt
794794
output.
795795
796796
If both are specified, a _Bad Option_ error MUST be emitted
797-
and a _fallback value_ used as the resolved value of the _expression_.
797+
and a _fallback value_ used as the _resolved value_ of the _expression_.
798798
799799
> [!NOTE]
800800
> The names of _options_ and their _values_ were derived from the

spec/syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Attempting to parse a _message_ that is not _valid_ will result in a _Data Model
9797

9898
A **_<dfn>message</dfn>_** is the complete template for a specific message formatting request.
9999

100-
A **_<dfn>variable</dfn>_** is a _name_ associated to a resolved value.
100+
A **_<dfn>variable</dfn>_** is a _name_ associated with a _resolved value_.
101101

102102
An **_<dfn>external variable</dfn>_** is a _variable_
103103
whose _name_ and initial value are supplied by the caller
@@ -183,7 +183,7 @@ An **_<dfn>input-declaration</dfn>_** binds a _variable_ to an external input va
183183
The _variable-expression_ of an _input-declaration_
184184
MAY include an _annotation_ that is applied to the external value.
185185

186-
A **_<dfn>local-declaration</dfn>_** binds a _variable_ to the resolved value of an _expression_.
186+
A **_<dfn>local-declaration</dfn>_** binds a _variable_ to the _resolved value_ of an _expression_.
187187

188188
For compatibility with later MessageFormat 2 specification versions,
189189
_declarations_ MAY also include _reserved statements_.

test/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ When resolving a `:test:function` expression,
5252
its `Input` and `DecimalPlaces` values are determined as follows:
5353

5454
1. Let `DecimalPlaces` be 0.
55-
1. Let `arg` be the resolved value of the _expression_ _operand_.
56-
1. If `arg` is the resolved value of an _expression_
55+
1. Let `arg` be the _resolved value_ of the _expression_ _operand_.
56+
1. If `arg` is the _resolved value_ of an _expression_
5757
with a `:test:function`, `:test:select`, or `:test:format` _annotation_
5858
for which resolution has succeeded, then
5959
1. Let `Input` be the `Input` value of `arg`.
@@ -63,15 +63,15 @@ its `Input` and `DecimalPlaces` values are determined as follows:
6363
1. Let `Input` be the numerical value of `arg`.
6464
1. Else,
6565
1. Emit "bad-input" _Resolution Error_.
66-
1. Use a _fallback value_ as the resolved value of the _expression_.
66+
1. Use a _fallback value_ as the _resolved value_ of the _expression_.
6767
Further steps of this algorithm are not followed.
6868
1. If the `decimalPlaces` _option_ is set, then
6969
1. If its value resolves to a numerical integer value 0 or 1
7070
or their corresponding string representations `'0'` or `'1'`, then
7171
1. Set `DecimalPlaces` to be the numerical value of the _option_.
7272
1. Else if its value is not an unresolved value set by _option resolution_,
7373
1. Emit "bad-option" _Resolution Error_.
74-
1. Use a _fallback value_ as the resolved value of the _expression_.
74+
1. Use a _fallback value_ as the _resolved value_ of the _expression_.
7575

7676
When `:test:function` is used as a _selector_,
7777
the behaviour of calling it as the `rv` value of MatchSelectorKeys(`rv`, `keys`)
@@ -87,7 +87,7 @@ depends on its `Input` and `DecimalPlaces` values.
8787

8888
When an _expression_ with a `:test:function` _annotation_ is assigned to a _variable_ by a _declaration_
8989
and that _variable_ is used as an _option_ value,
90-
its resolved value is the `Input` value.
90+
its _resolved value_ is the `Input` value.
9191

9292
When `:test:function` is used as a _formatter_,
9393
a _placeholder_ resolving to a value with a `:test:function` _expression_

0 commit comments

Comments
 (0)