Skip to content
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

Parse the remaining sections from the binary WASM format #67

Merged
merged 13 commits into from
Jan 30, 2025

Conversation

virgil-serbanuta
Copy link
Member

@virgil-serbanuta virgil-serbanuta commented Jan 27, 2025

Closes #62

@virgil-serbanuta virgil-serbanuta changed the title Parse table Parse the remaining sections from the binary WASM format Jan 27, 2025
@virgil-serbanuta virgil-serbanuta force-pushed the parse-table branch 2 times, most recently from e3ad34e to eebb271 Compare January 27, 2025 14:12
@virgil-serbanuta virgil-serbanuta changed the base branch from master to parse-functions-refactor January 27, 2025 14:42
Base automatically changed from parse-functions-refactor to master January 28, 2025 12:07
@virgil-serbanuta virgil-serbanuta marked this pull request as ready for review January 28, 2025 13:18
Copy link

@sskeirik sskeirik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

I agree with commentary about exports --- they look fishy and don't respect the namespace structure of modules --- however, that is something that we can address down the road.

syntax DefnResult ::= parseElem1(BytesWithIndex) [function, total]
| #parseElem1a(BytesWithIndexOrError) [function, total]
| #parseElem1b(IntsResult) [function, total]
rule parseElem1(BWI:BytesWithIndex) => #parseElem1a(parseConstant(BWI, b"\x00"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a small nit; I would prefer to our existing macro for this constant to help readability a bit.

Also, right now, the macro is called ELT_KIND, but I think it might be better to call it ELT_KIND_FUNCREF --- I didn't pay close enough attention to realize that element kind reduces to a type.

The same applies to the other uses of the zero byte.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@virgil-serbanuta virgil-serbanuta merged commit 0bcb309 into master Jan 30, 2025
3 checks passed
@virgil-serbanuta virgil-serbanuta deleted the parse-table branch January 30, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse the remaining WASM Binary format sections
2 participants