mirror of
https://github.com/ziglang/zig.git
synced 2026-11-11 23:19:30 -05:00
explicitly return from blocks
instead of last statement being expression value closes #629
This commit is contained in:
1 parent
8bc523219c
commit
d917815d81
114 files changed
+1203
-1231
No files matched your search
+1
-4
@@ -478,10 +478,7 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
|
||||
AstNode *statement = node->data.block.statements.at(i);
|
||||
print_indent(ar);
|
||||
render_node_grouped(ar, statement);
|
||||
if (!(i == node->data.block.statements.length - 1 &&
|
||||
node->data.block.last_statement_is_result_expression)) {
|
||||
fprintf(ar->f, ";");
|
||||
}
|
||||
fprintf(ar->f, ";");
|
||||
fprintf(ar->f, "\n");
|
||||
}
|
||||
ar->indent -= ar->indent_size;
|
||||
|
||||
Reference in new issue
Block a user