Conversation
|
The name annotation might technically be more expressive, but is there any demand for it? We shouldn't spec something that nobody implements or uses. |
|
Well, the idea underlying this proposal is that every custom section should have a text equivalent. |
| \production{identifier} & \Tid &::=& | ||
| \text{\$}~\Tidchar^+ \\ | ||
| \text{\$}~c^\ast{:}\Tidchar^+ &\Rightarrow& c^\ast \\ &&|& | ||
| \text{\$}~c^\ast{:}\Tname &\Rightarrow& c^\ast & (\iff |c^\ast| > 0) \\ |
There was a problem hiding this comment.
Why disallow the empty name? $"" seems like it should be a valid identifier.
| ~~~~~~~~~~~ | ||
|
|
||
| An *annotation* is a bracketed token sequence headed by an *annotation id* of the form :math:`\T{@id}`. | ||
| An *annotation* is a bracketed token sequence headed by an *annotation id* of the form :math:`\text{@id}` or :math:`\text{@"..."}`. |
There was a problem hiding this comment.
The rendering of \text{@"..."} is pretty ugly. Can we use \ldots in there to make it prettier?
The syntax for arbitrary custom sections means that this goal is met without the |
|
In the abstract I do not personally have a use case for My comment there though was also specifically addressing the point that if the purpose of |
I'm afraid that's apples vs potatoes: the existing spec of the name section already requires referenced indices to exist, but at the same time explicitly allows multiple names for a given index. The custom section validator implemented for the reference interpreter as part of this proposal even checks it accordingly. ;) |
Address #21.
Allow arbitrary non-empty names (well-formed unicode string literals) as identifiers.
Extend spec, interpreter, and test suite.
Note: This PR does not per se remove the explicit @name annotations from the proposal, because they are not equivalent: they express the actual presence of a corresponding custom section, whereas the use of symbolic names doesn't, even though they can be utilised by a tool to construct such a custom section (as before). Also, annotations are more expressive, e.g., can provide alternative names to the same binder, i.e., quoted identifiers are not sufficient to convert all forms of name section into text.