-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add Resolved Values and Function Handler sections to formatting #728
Changes from 10 commits
a99f6cb
3d31e10
512c14f
17a9830
94098ca
ecb071c
28cb811
050dd9b
6e93724
55caa12
2b48b88
1646e68
df21df3
ec3e484
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,7 +269,7 @@ a reference to a function which cannot be resolved. | |
### Bad Selector | ||
|
||
A **_<dfn>Bad Selector</dfn>_** error occurs when a message includes a _selector_ | ||
with a resolved value which does not support selection. | ||
with a _resolved value_ which does not support selection. | ||
|
||
> For example, attempting to format this message | ||
> would result in a _Bad Selector_ error: | ||
|
@@ -283,10 +283,10 @@ with a resolved value which does not support selection. | |
## Message Function Errors | ||
|
||
A **_<dfn>Message Function Error</dfn>_** is any error that occurs | ||
when calling a message function implementation | ||
when calling a _function handler_ | ||
or which depends on validation associated with a specific function. | ||
|
||
Implementations SHOULD provide a way for _functions_ to emit | ||
Implementations SHOULD provide a way for _function handlers_ to emit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't find a definition of what a "function handler" is. Which file is that in? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's added by this PR to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see a definition; just references. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's a link to the section in this PR's branch: https://github.com/unicode-org/message-format-wg/blob/define-resolved-values/spec/formatting.md#function-handler |
||
(or cause to be emitted) any of the types of error defined in this section. | ||
Implementations MAY also provide implementation-defined _Message Function Error_ types. | ||
|
||
|
@@ -300,7 +300,7 @@ Implementations MAY also provide implementation-defined _Message Function Error_ | |
> 3. Uses a `:get` message function which requires its argument to be an object and | ||
> an option `field` to be provided with a string value. | ||
> | ||
> The exact type of _Message Function Error_ is determined by the message function implementation. | ||
> The exact type of _Message Function Error_ is determined by the _function handler_. | ||
> | ||
> ``` | ||
> Hello, {horse :get field=name}! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused. Can you give an example of a selector that supports selection where its resolved value doesn't?
That is, if I have
.input {$num :number}
.match $num
...
How could :number ever have a resolved value that didn't support selection? I think the notion of 'resolved value' doesn't help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going with the example you posted above, if that message is formatted without a
num
argument, then the first step of Function Resolution applies:And then this part of Fallback Resolution applies:
And so we end up emitting two errors when formatting:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @macchiati's finger is on the right thing. It's not a technical problem. This is just hard to understand. Perhaps:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we spin this suggestion off into a separate PR? As is, the only change that is being applied here is linkifying resolved value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me as a solution.