Skip to content

Commit 83d8011

Browse files
committed
Use last rather than earliest operand for fallback value
1 parent 38c8542 commit 83d8011

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

spec/formatting.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,9 @@ the following steps are taken:
266266
267267
1. If the _expression_ includes an _operand_, resolve its value.
268268
If this is a _fallback value_,
269-
return the _fallback value_ as the _resolved value_ of the _expression_.
270-
2. Resolve the _identifier_ of the _function_ and, based on the starting sigil,
269+
return a _fallback value_ as the _resolved value_ of the _expression_.
270+
271+
2. Resolve the _identifier_ of the _function_ and
271272
find the appropriate _function handler_ to call.
272273
If the implementation cannot find the _function handler_,
273274
or if the _identifier_ includes a _namespace_ that the implementation does not support,
@@ -292,7 +293,7 @@ the following steps are taken:
292293
supported by the implementation, process them as specified.
293294
Such `u:` options MAY be removed from the resolved mapping of _options_.
294295
295-
5. Call the function implementation with the following arguments:
296+
5. Call the _function handler_ with the following arguments:
296297
297298
- The _function context_.
298299
- The resolved mapping of _options_.
@@ -418,7 +419,8 @@ An _expression_ fails to resolve when:
418419
- A _variable_ used as its _operand_ resolves to a _fallback value_.
419420
Note that an _expression_ does not necessarily fail to resolve
420421
if an _option_ resolves with a _fallback value_.
421-
- A _function_ fails to resolve.
422+
- No _function handler_ is found for a _function_ _identifier_.
423+
- Calling a _function handler_ fails or does not return a valid value.
422424
423425
The string representation of the _fallback value_ of an _expression_ depends on its contents:
424426
@@ -433,30 +435,26 @@ The string representation of the _fallback value_ of an _expression_ depends on
433435
> `{42 :func}` resolves to the _fallback value_ `|42|` and
434436
> `{|C:\\| :func}` resolves to the _fallback value_ `|C:\\|`.
435437
436-
- _expression_ with a _variable_ _operand_ referring to a _declaration_:
437-
the string representation of the _fallback value_ of the _expression_ of that _declaration_.
438+
- _expression_ with _variable_ _operand_:
439+
the _fallback value_ representation of that _variable_,
440+
U+0024 DOLLAR SIGN `$` followed by the _name_ of the _variable_
438441
439442
> Examples:
443+
> In a context where `$var` fails to resolve, `{$var}` and `{$var :number}`
444+
> both resolve to the _fallback value_ `$var`
445+
> (even if `:number` fails to resolve).
446+
>
440447
> In a context where `:func` fails to resolve,
441448
> the _placeholder_ in `.local $var = {|val| :func} {{{$var}}}`
442-
> resolves to the _fallback value_ `|val|`.
449+
> resolves to the _fallback value_ `$var`.
443450
>
444-
> In a context where `:pretty` fails to resolve but `:now` does not,
451+
> In a context where either `:now` or `:pretty` fails to resolve,
445452
> the _placeholder_ in
446453
> ```
447-
> .local $t = {:now format=iso8601}
448-
> {{{$t :pretty}}}
454+
> .local $time = {:now format=iso8601}
455+
> {{{$time :pretty}}}
449456
> ```
450-
> resolves to the _fallback value_ `:now`.
451-
452-
- _expression_ with _variable_ _operand_ not referring to a _declaration_:
453-
the _fallback value_ representation of that _variable_,
454-
U+0024 DOLLAR SIGN `$` followed by the _name_ of the _variable_
455-
456-
> Examples:
457-
> In a context where `$var` fails to resolve, `{$var}` and `{$var :number}`
458-
> both resolve to the _fallback value_ `$var`
459-
> (even if `:number` fails to resolve).
457+
> resolves to the _fallback value_ `$time`.
460458
461459
- _function_ _expression_ with no _operand_:
462460
U+003A COLON `:` followed by the _function_ _identifier_

0 commit comments

Comments
 (0)