-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix return
representation in Ast
#256
Conversation
Ah, nice, I hadn't even noticed that |
Adjust `if` to match post-order format.
@lukewagner, is that an LGTM? :) Btw, I screwed up my branching, so that #257 is included in this branch. Sorry about that, just look at the first commit. |
oops, yes :) |
Fix `return` representation in Ast
Thanks :) |
@@ -95,7 +95,7 @@ | |||
(loop | |||
(if | |||
(i32.eq (get_local 0) (i32.const 0)) | |||
(br 1) | |||
(br 2) |
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 pull is for return
- why did these br
s change?
And where does 2 go? the only block
s or loops
above this br
are the one loop
, which would take indexes 0 and 1?
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.
if has an implicit label now too. Change was here: 0568800. Not sure why it didn't break then.
edit: oh, it got added in to this merge accidentally.
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! now i see
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.
Sorry for this, I messed up the branching, and accidentally merged the if
changes into the return
branch instead of master. This line is part of the if
changes (if
now has an implicit block).
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.
is it the if that has an implicit block, or the then and else branches that do? because I see they can have a label name on them now? must it be the same for both of them if there is?
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.
The branches have implicit blocks, so the labels go there (also, that makes it clear that they are not in scope in the condition). They can be named differently, see the examples in test/labels.wast.
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.
got it, thanks!
This makes some cosmetic changes to the identity-preserving `rethrow` test added in WebAssembly#253. This is to prepare for adding the same set of tests for a Wasm-defined-and-exported tag, as requrested in WebAssembly/exception-handling#253 (comment).
Ast.Return
improperly had a label argument to support its desugaring. That is now removed, and the logic properly encapsulated in desugaring.