Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions spec/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ and different implementations MAY choose to perform different levels of resoluti

_Expressions_ are used in _declarations_ and _patterns_.
_Markup_ is only used in _patterns_.
_Options_ are used in _expressions_ and _markup_.

#### Expression Resolution

Expand Down Expand Up @@ -342,7 +343,7 @@ the following steps are taken:
Specifically, if the cause of the failure was that the datatype, value, or format of the
_operand_ did not match that expected by the _function_,
the _function_ SHOULD cause a _Bad Operand_ error to be emitted.

In all failure cases, return a _fallback value_ as the _resolved value_ of the _expression_.

###### Function Handler
Expand Down Expand Up @@ -377,10 +378,29 @@ and execution time SHOULD be limited.

Implementation-defined _functions_ SHOULD use an implementation-defined _namespace_.

###### Option Resolution
#### Markup Resolution

**_<dfn>Markup resolution</dfn>_** determines the value of _markup_.
Unlike _functions_, the resolution of _markup_ is not customizable.

The _resolved value_ of _markup_ includes the following fields:

- The type of the markup: open, standalone, or close
- The _identifier_ of the _markup_
- The resolved mapping of _options_ after _option resolution_.

If the resolved mapping of _options_ includes any _`u:` options_
supported by the implementation, process them as specified.
Such `u:` options MAY be removed from the resolved mapping of _options_.

The resolution of _markup_ MUST always succeed.
(Any errors emitted by _option resolution_
are non-fatal.)

#### Option Resolution

**_<dfn>Option resolution</dfn>_** is the process of computing the _options_
for a given _expression_.
for a given _expression_ or _markup_.
_Option resolution_ results in a mapping of string _identifiers_ to _resolved values_.
The order of _options_ MUST NOT be significant.

Expand Down Expand Up @@ -418,23 +438,6 @@ This mapping can be empty.
> These are not included in the _option resolution_ result,
> and need to be processed separately by a _function handler_.

#### Markup Resolution

**_<dfn>Markup resolution</dfn>_** determines the value of _markup_.
Unlike _functions_, the resolution of _markup_ is not customizable.

The _resolved value_ of _markup_ includes the following fields:

- The type of the markup: open, standalone, or close
- The _identifier_ of the _markup_
- The resolved mapping of _options_ after _option resolution_.

If the resolved mapping of _options_ includes any _`u:` options_
supported by the implementation, process them as specified.
Such `u:` options MAY be removed from the resolved mapping of _options_.

The resolution of _markup_ MUST always succeed.

#### Fallback Resolution

A **_<dfn>fallback value</dfn>_** is the _resolved value_ for
Expand Down