Closed amorphedstar closed 2 months ago
This is looking slick. Is it about ready for merging?
Would be nice to add a simple test for some things, including a test that would trip up the inliner with the returns.
I added two simple tests, but wasn't quite sure the best place to put them. And I think it should be about ready to merge if you think it's fine having all these extra block
s now in the codegen output, and potentially unclearer return names in a few places that had special codegen behavior, like node-bind
in the case when node-bind-expr
is a node-abstraction
.
This is looking slick. Is it about ready for merging?
Would be nice to add a simple test for some things, including a test that would trip up the inliner with the returns.
I added two simple tests, but wasn't quite sure the best place to put them. And I think it should be about ready to merge if you think it's fine having all these extra
block
s now in the codegen output, and potentially unclearer return names in a few places that had special codegen behavior, likenode-bind
in the case whennode-bind-expr
is anode-abstraction
.
Since blocks are only useful if there's a lexically apparent return, maybe we can (either in this PR or future) only emit a block when needed.
Inlining bodies of functions with return nodes would make it so they returned to the most recent non-inlined function, which is wrong. This PR creates
node-block
andnode-return-from
and implements a traversal to fix this.