-
Notifications
You must be signed in to change notification settings - Fork 73
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
Use open
instead of final
in the text format
#413
Changes from all commits
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 |
---|---|---|
|
@@ -85,8 +85,8 @@ Abbreviations | |
There are shorthands for references to abstract heap types. | ||
|
||
.. math:: | ||
\begin{array}{llclll} | ||
\production{reference type} & | ||
\begin{array}{lcl} | ||
\production{reference type} | ||
\text{anyref} &\equiv& \text{(}~\text{ref}~~\text{null}~~\text{any}~\text{)} \\ | ||
\text{eqref} &\equiv& \text{(}~\text{ref}~~\text{null}~~\text{eq}~\text{)} \\ | ||
\text{i31ref} &\equiv& \text{(}~\text{ref}~~\text{null}~~\text{i31}~\text{)} \\ | ||
|
@@ -255,30 +255,33 @@ Recursive Types | |
\text{(}~\text{type}~~\Tid^?~~\X{st}{:}\Tsubtype_I~\text{)} | ||
&\Rightarrow& \X{st} \\ | ||
\production{sub type} & \Tsubtype_I &::=& | ||
\text{(}~\text{sub}~~\text{final}^?~~x^\ast{:\,}\Tvec(\Ttypeidx_I)~~\X{ct}{:}\Tcomptype_I~\text{)} | ||
\text{(}~\text{sub}~~\text{open}^?~~x^\ast{:\,}\Tvec(\Ttypeidx_I)~~\X{ct}{:}\Tcomptype_I~\text{)} | ||
&\Rightarrow& \TSUB~\TFINAL^?~x^\ast~\X{ct} \\ | ||
\end{array} | ||
|
||
.. note:: | ||
A subtype is :ref:`final <syntax-subtype>` if the :math:`\text{open}` keyword is not present, and vice versa. | ||
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. See above, this comment shouldn't be needed if the text format is consistent with the AST. |
||
|
||
|
||
Abbreviations | ||
............. | ||
|
||
Singular recursive types can omit the |Trec| keyword: | ||
Singular recursive types can omit the :math:`\text{rec}` keyword: | ||
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. Why this change? 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. Because it refers to a keyword of the text format, not a structural element of a wasm module. The primary difference is in how they render, but suppose the structural element were named "recgrp" instead of "rec" - if that were the case, the sentence would make no sense, as 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 may be useful to note that macros.def does not define 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. Ah, good points. 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. Done as a standalone fix in #426. |
||
|
||
.. math:: | ||
\begin{array}{llclll} | ||
\begin{array}{lcl} | ||
\production{recursive type} & | ||
\Tsubtype &\equiv& | ||
\text{(}~~\text{rec}~~\Tsubtype~~\text{)} \\ | ||
\Tdeftype &\equiv& | ||
\text{(}~~\text{rec}~~\Tdeftype~~\text{)} \\ | ||
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. This is not related to my work, but I believe it to be a bug in the spec that is easy to fix. 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. No, I think this was correct before. 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 how it could be correct before. According to the grammar above, recursion groups contain deftypes ( 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. @bvisness's fix here looks right to me. We don't want to allow 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. Ah, you are right, I was confused by the impedance mismatch with the abstract syntax, where deftype is something else. We should probably not be naming this one in the text format deftype, but rather something else (typedef?). |
||
\end{array} | ||
|
||
Similarly, final sub types with no super-types can omit the |Tsub| keyword and arguments: | ||
Similarly, final sub types with no super-types can omit the :math:`\text{sub}` keyword: | ||
|
||
.. math:: | ||
\begin{array}{llclll} | ||
\begin{array}{lcl} | ||
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 think this needs to be at least |
||
\production{sub type} & | ||
\Tcomptype &\equiv& | ||
\text{(}~~\text{sub}~~\text{final}~~\epsilon~~\Tcomptype~~\text{)} \\ | ||
\text{(}~~\text{sub}~~\Tcomptype~~\text{)} \\ | ||
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 not clear to me why the 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 probably represented the empty vector of supertypes. I think it would make sense to put it and the "and arguments" language back. 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. What @tlively said, this was intentional. |
||
\end{array} | ||
|
||
|
||
|
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.
This is also unrelated to my work, but this table was jank, and now it is not.
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.
Ah, the production name needs its own column, in case its used. The correct fix here is to add
&
's below, i.e., change each\\
to\\&
(perhaps except the last). You can simplify the column scheme to{llcl}
.