-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: Add hexadecimal notation support for integer arguments #9989
base: main
Are you sure you want to change the base?
Conversation
Add support for parsing hexadecimal integers (prefixed with 0x or 0X) when passing arguments to WebAssembly functions. This enhancement allows users to specify integer arguments in both decimal and hexadecimal formats. For example: - Decimal: 42 - Hexadecimal: 0x2A or 0x2a The change affects both i32 and i64 argument types while maintaining backward compatibility with decimal notation.
Thanks! Mind adding a test for this as well? (probably somewhere in |
Defines a module with a single function sum Takes two i32 parameters and returns their sum Uses basic WebAssembly instructions to add the numbers
Builds a WebAssembly module from our WAT file Invokes the sum function with two hexadecimal numbers (0x2A and 0xFF) Verifies that the output is correct (297, which is 42 + 255)
Thank you for the answer. I did what you asked |
(I think there's a test failure though?) |
Yes)) Gonna correct it soon |
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.
Thanks!
Looks like there are still some failing CI jobs that need to be fixed before this can merge. |
Working on it)) |
Add support for parsing hexadecimal integers (prefixed with 0x or 0X) when passing arguments to WebAssembly functions. This enhancement allows users to specify integer arguments in both decimal and hexadecimal formats.
For example:
The change affects both i32 and i64 argument types while maintaining backward compatibility with decimal notation.