Wrap the tableswitch default target in a (default ...) node#191
Wrap the tableswitch default target in a (default ...) node#191AndrewScheidecker wants to merge 1 commit intoWebAssembly:masterfrom
Conversation
|
It would be much better if this were a part of the case node instead of a new imaginary (i.e. not actually a functional part of the AST or encoded into binary) s-expression node that adds extra nesting. We have something like |
|
I went with
Then you'd also need |
|
I agree the syntax of the default target can be slightly irritating, but is it really a problem serious enough to justify adding extra syntactic baggage? If we think so, then I'd rather revive the earlier suggestion of simply including the default in the table, and define dispatch by clamping the index value. See #163 (comment) and subsequent discussion. At least that would make the syntax simpler, not more complicated, though I also understand Dan's reservations. Another option would be to use a different keyword for the |
|
Another alternative is to remove the default from |
…omething like (default (case x)) stands out from its (case ...) siblings that define targets rather than references to targets.
035e5d8 to
8ce9244
Compare
|
Obsolete with br_table, closing. |
Wrap the tableswitch default target in a (default ...) node so that something like (default (case x)) stands out from its (case ...) siblings that define targets rather than references to targets.
Before:
After: