-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor how operand immediates are printed Delegate the space-before-immediate to printing the immediate itself rather than forcing a space between each immediate. Avoids the need to `pop()` or otherwise test if space is already present in situations where immediates are omitted. * Add a test exercising labels * Update how operators are printed in `wasmprinter` Previously operators were printed to a temporary buffer and then depending on what happened it would conditionally go into the actual module or instead be discarded (e.g. the last `end`). This commit refactors to instead avoid a temporary buffer entirely and unconditionally emit instructions to the real output. This is done by restructuring the printing slightly by having "before_op" and "after_op" hooks while printing which are used to manage nesting/newlines instead of the outer loop in the main printer. This is combined with a few other minor things such as a `is_end_then_eof` method which is used to avoid printing the final `end`. One minor test update happened here with a `delegate` instruction from the legacy exception-handling proposal which I think is a bugfix given my read of the older proposal. * Review comments
- Loading branch information
1 parent
9340ed2
commit 7a7815f
Showing
8 changed files
with
205 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.