-
Notifications
You must be signed in to change notification settings - Fork 17
Conversation
No functional changes. This will help parsing of type-immediate ref.null and ref.is_null. Eventually we may be able to combine TableElemType with RefType as well.
#[allow(missing_docs)] | ||
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone)] | ||
pub enum RefType<'a> { | ||
Func, |
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.
Mind adding a few comments to the variants here? The first two I think are reference-types proposal types, the next is exception handling, and everything else is the gc proposal, right?
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.
Yes, that's the case. I've added some comments explaining the types.
crates/wast/src/ast/types.rs
Outdated
parser.parse::<kw::r#extern>()?; | ||
Ok(RefType::Extern) | ||
} else if l.peek::<kw::any>() { | ||
parser.parse::<kw::any>()?; |
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.
Are there any old tests using (ref any)
after everything is renamed?
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.
No, there shouldn't really be any. Might be some in wabt, but they'll update at some point. I've removed the alias for this form.
d7bff68
to
c5ef489
Compare
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 a new file accidentally snuck in but otherwise with the upstream spec now merged I think we can go ahead and land this.
The type uses the formal reference-types production, so it's `ref.null any` not `ref.null anyref`. The elem segment parser also had to be updated to check the type of ref.null used is compatible with the element segment type. This is tricky with subtypes, so for now it just does strict equality.
`anyref` is going to be a tricky thing to rename, if even possible. For now an alias seems to be reasonable.
This is unfortunate, but I don't see a way around it if we want to not be blocked on wabt. At the least, we do have extensive test coverage in spidermonkey for these testsuites that will continue.
Yes, let's merge this and get a new version when you get a chance! |
This is the equivalent of the syntax changes in WebAssembly/reference-types/pull/87. I have a corresponding patch in SpiderMonkey that tests this out with the semantics changes as well.
It may be good to hold off on merging this until the upstream PR is closer to merging, to track any changes. I'm posting this now to just get ready for when that is.