-
Notifications
You must be signed in to change notification settings - Fork 11
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
Allow quoted identifiers #23
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. |
|
||
.. math:: | ||
\begin{array}{llclll@{\qquad}l} | ||
\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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why disallow the empty name? $""
seems like it should be a valid identifier.
@@ -133,7 +133,7 @@ The *look-ahead* restrictions on the productions for |Tblockchar| disambiguate t | |||
Annotations | |||
~~~~~~~~~~~ | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.