Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 185f201

Browse files
authored
Include explicit text on literal option origin (#1019)
* Include explicit text on literal option origin * Clarify normative requirement
1 parent f8772c0 commit 185f201

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spec/formatting.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ as well as a flag to indicate whether
137137
its formatted representation requires isolation
138138
from the surrounding text.
139139
140+
To allow for _function handlers_ to ensure that certain _option_ values are set by _literals_,
141+
the _resolved value_ of each _option_ value MUST include information about
142+
whether the _option_ value is a _literal_ or a _variable_.
143+
140144
The form that _resolved values_ take is implementation-dependent,
141145
and different implementations MAY choose to perform different levels of resolution.
142146
@@ -153,6 +157,7 @@ and different implementations MAY choose to perform different levels of resoluti
153157
> selectKeys(keys: string[]): string[]
154158
> directionality(): 'LTR' | 'RTL' | 'unknown'
155159
> isolate(): boolean
160+
> isLiteralOptionValue(): boolean
156161
> }
157162
> ```
158163
>
@@ -369,7 +374,7 @@ Implementation-defined _functions_ SHOULD use an implementation-defined _namespa
369374
370375
**_<dfn>Option resolution</dfn>_** is the process of computing the _options_
371376
for a given _expression_.
372-
_Option resolution_ results in a mapping of string _identifiers_ to _values_.
377+
_Option resolution_ results in a mapping of string _identifiers_ to _resolved values_.
373378
The order of _options_ MUST NOT be significant.
374379
375380
> For example, the following _message_ treats both both placeholders identically:
@@ -386,6 +391,8 @@ For each _option_:
386391
1. If `rv` is a _fallback value_:
387392
1. If supported, emit a _Bad Option_ error.
388393
1. Else:
394+
1. If the _option_ value was set by a _literal_:
395+
1. Include that information in `rv`.
389396
1. Set `res[id]` to be `rv`.
390397
1. Return `res`.
391398

0 commit comments

Comments
 (0)