-
Notifications
You must be signed in to change notification settings - Fork 516
Description
While working on #35 I ran into many significant mismatches with AstSemantics from the design repo. I think most of them are wrong:
There's no continue node. This can be awkwardly emulated with More Labels(tm) but we shouldn't do that. We should implement it.
switch uses break to suppress fallthrough at the end of a case, which is problematic, because it's overloading the normal break $label form in a way that is ambiguous. Fallthrough appears to be automatic, instead of opt-in, also. I think it should be explicit, and the default should be non-fallthrough - that way break isn't needed. That or we define a dedicated opcode like case-break.
AstSemantics specifies do-while and forever loop types; the prototype only has loop. This further complicates emulating continue since you need to make sure you jump to the right place.
comma isn't implemented. That will be a problem when trying to emulate particular logical/arithmetic constructs common in C++ and C#.