Skip to content

Commit 0084f28

Browse files
authored
feat: add tail to block generation util (#195)
1 parent e6539d3 commit 0084f28

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

ecsact/cpp_codegen_plugin_util.hh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,24 @@ auto block( //
188188

189189
auto block( //
190190
ecsact::codegen_plugin_context& ctx,
191-
auto&& block_prefix,
191+
auto&& block_head,
192192
std::invocable auto&& block_body_fn
193193
) {
194-
ctx.write(block_prefix, " ");
194+
ctx.write(block_head, " ");
195195
auto printer = block_printer{ctx};
196196
block_body_fn();
197197
}
198198

199+
auto block( //
200+
ecsact::codegen_plugin_context& ctx,
201+
auto&& block_head,
202+
std::invocable auto&& block_body_fn,
203+
auto&& block_tail
204+
) {
205+
ctx.write(block_head, " ");
206+
auto printer = block_printer{ctx};
207+
block_body_fn();
208+
ctx.write(block_tail);
209+
}
210+
199211
} // namespace ecsact::cpp_codegen_plugin_util

0 commit comments

Comments
 (0)