Skip to content

Commit

Permalink
feat: add tail to block generation util
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed May 27, 2024
1 parent e6539d3 commit 371a742
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ecsact/cpp_codegen_plugin_util.hh
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,24 @@ auto block( //

auto block( //
ecsact::codegen_plugin_context& ctx,
auto&& block_prefix,
auto&& block_head,
std::invocable auto&& block_body_fn
) {
ctx.write(block_prefix, " ");
ctx.write(block_head, " ");
auto printer = block_printer{ctx};
block_body_fn();
}

auto block( //
ecsact::codegen_plugin_context& ctx,
auto&& block_head,
std::invocable auto&& block_body_fn,
auto&& block_tail
) {
ctx.write(block_head, " ");
auto printer = block_printer{ctx};
block_body_fn();
ctx.write(block_tail);
}

} // namespace ecsact::cpp_codegen_plugin_util

0 comments on commit 371a742

Please sign in to comment.