Open shinymerlyn opened 2 years ago
In the Wiz Discord, @Bananattack also suggested putting function-hoisted labels in some sort of "namespace".
e.g. in the second case, the syntax would be goto SomeFunction.SomeLabel
.
I think this wouldn't really affect the first case. It should probably still be goto PartWayThroughLoop
for that use case I think?
I'd like to have a flag for labels that lets me hoist them from some inner scope to a top-level scope.
I don't think I'd necessarily write code this way, but existing assembly code often has hairy control flow, and Wiz is a pretty nice target for manual disassembly. Code that's been optimized for binary size is often especially patchy when it comes to control flow. Breaking up the code into a bunch of tiny fallthrough functions always "works", but it doesn't necessarily capture the semantics in some cases as my proposal would.
Examples of what I'd like to see working: