Skip to content

Commit 1b925bf

Browse files
aphillipseemeli
andauthored
Clarify option resolution regarding fallback option values (#1054)
* Make option resolution return something if `rv` is a fallback value Fixes #1053. * Add note and rephrase slightly Added a note explaining the fallback resolved values are not valid options and the option is thus omitted. I also reworded the emit-bad-option step to make it not look like an if statement missing an else * Update spec/formatting.md Co-authored-by: Eemeli Aro <[email protected]> * Update spec/formatting.md Co-authored-by: Eemeli Aro <[email protected]> --------- Co-authored-by: Eemeli Aro <[email protected]>
1 parent e032c1c commit 1b925bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spec/formatting.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,17 @@ For each _option_:
395395
1. Let `id` be the string value of the _identifier_ of the _option_.
396396
1. Let `rv` be the _resolved value_ of the _option value_.
397397
1. If `rv` is a _fallback value_:
398-
1. If supported, emit a _Bad Option_ error.
398+
1. Emit a _Bad Option_ error, if supported.
399399
1. Else:
400400
1. If the _option value_ consists of a _literal_:
401401
1. Mark `rv` as a _literal_ _option value_.
402402
1. Set `res[id]` to be `rv`.
403403
1. Return `res`.
404404
405+
> [!NOTE]
406+
> If the _resolved value_ of an _option value_ is a _fallback value_,
407+
> the _option_ is intentionally omitted from the mapping of resolved options.
408+
405409
The result of _option resolution_ MUST be a (possibly empty) mapping
406410
of string identifiers to values;
407411
that is, errors MAY be emitted, but such errors MUST NOT be fatal.

0 commit comments

Comments
 (0)