Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Composition with Resolved Value sections for default functions #927

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
74 changes: 36 additions & 38 deletions spec/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ The function `:string` has no options.
> Proposals for string transformation options or implementation
> experience with user requirements is desired during the Tech Preview.

#### Resolved Value

The _resolved value_ of an _expression_ with a `:string` _function_
contains the string value of the _operand_ of the annotated _expression_,
together with its resolved locale and directionality.
None of the _options_ set on the _expression_ are part of the _resolved value_.

#### Selection

When implementing [`MatchSelectorKeys(resolvedSelector, keys)`](/spec/formatting.md#resolve-preferences)
Expand Down Expand Up @@ -86,14 +93,6 @@ The `:string` function returns the string value of the _resolved value_ of the _
> Users SHOULD encode _messages_ and their parts in Unicode Normalization Form C (NFC)
> unless there is a very good reason not to.

#### Composition

When an _operand_ or an _option_ value uses a _variable_ annotated,
directly or indirectly, by a `:string` _function_,
its _resolved value_ contains the string value of the _operand_ of the annotated _expression_,
together with its resolved locale and directionality.
None of the _options_ set on the _expression_ are part of the _resolved value_.

## Numeric Value Selection and Formatting

### The `:number` function
Expand Down Expand Up @@ -235,18 +234,17 @@ MUST be multiplied by 100 for the purposes of formatting.
> should format in a manner similar to:
> > The total was 50%.

#### Selection

The _function_ `:number` performs selection as described in [Number Selection](#number-selection) below.

#### Composition
#### Resolved Value

When an _operand_ or an _option_ value uses a _variable_ annotated,
directly or indirectly, by a `:number` _annotation_,
its _resolved value_ contains an implementation-defined numerical value
The _resolved value_ of an _expression_ with a `:number` _function_
contains an implementation-defined numerical value
of the _operand_ of the annotated _expression_,
together with the resolved options' values.

#### Selection

The _function_ `:number` performs selection as described in [Number Selection](#number-selection) below.

### The `:integer` function

The function `:integer` is a selector and formatter for matching or formatting numeric
Expand Down Expand Up @@ -372,18 +370,17 @@ MUST be multiplied by 100 for the purposes of formatting.
> should format in a manner similar to:
> > The total was 50%.

#### Selection

The _function_ `:integer` performs selection as described in [Number Selection](#number-selection) below.

#### Composition
#### Resolved Value

When an _operand_ or an _option_ value uses a _variable_ annotated,
directly or indirectly, by a `:integer` _annotation_,
its _resolved value_ contains the implementation-defined integer value
The _resolved value_ of an _expression_ with an `:integer` _function_
contains the implementation-defined integer value
of the _operand_ of the annotated _expression_,
together with the resolved options' values.

#### Selection

The _function_ `:integer` performs selection as described in [Number Selection](#number-selection) below.

### Number Operands

The _operand_ of a number function is either an implementation-defined type or
Expand Down Expand Up @@ -707,11 +704,10 @@ are encouraged to track development of these options during Tech Preview:
- `timeZone` (default is system default time zone or UTC)
- valid identifier per [BCP175](https://www.rfc-editor.org/rfc/rfc6557)

#### Composition
#### Resolved Value

When an _operand_ or an _option_ value uses a _variable_ annotated,
directly or indirectly, by a `:datetime` _annotation_,
its _resolved value_ contains an implementation-defined date/time value
The _resolved value_ of an _expression_ with a `:datetime` _function_
contains an implementation-defined date/time value
of the _operand_ of the annotated _expression_,
together with the resolved options values.

Expand Down Expand Up @@ -743,13 +739,14 @@ it can include other option values.
Any _operand_ option values matching the `:datetime` _style options_ or _field options_ are ignored,
as is any `style` option.

#### Composition
#### Resolved Value

The _resolved value_ of an _expression_ with a `:date` _function_
is implementation-defined.

When an _operand_ or an _option_ value uses a _variable_ annotated,
directly or indirectly, by a `:date` _annotation_,
its _resolved value_ is implementation-defined.
An implementation MAY emit a _Bad Operand_ or _Bad Option_ error (as appropriate)
when this happens.
when a _variable_ annotated directly or indirectly by a `:date` _annotation_
is used as an _operand_ or an _option_ value.

### The `:time` function

Expand Down Expand Up @@ -779,13 +776,14 @@ it can include other option values.
Any _operand_ option values matching the `:datetime` _style options_ or _field options_ are ignored,
as is any `style` option.

#### Composition
#### Resolved Value

The _resolved value_ of an _expression_ with a `:time` _function_
is implementation-defined.

When an _operand_ or an _option_ value uses a _variable_ annotated,
directly or indirectly, by a `:time` _annotation_,
its _resolved value_ is implementation-defined.
An implementation MAY emit a _Bad Operand_ or _Bad Option_ error (as appropriate)
when this happens.
when a _variable_ annotated directly or indirectly by a `:time` _annotation_
is used as an _operand_ or an _option_ value.

### Date and Time Operands

Expand Down