Ast Render no longer outputs erroneous semicolon

closes #813
This commit is contained in:
Jimmi Holst Christensen
2018-03-07 10:39:32 +01:00
parent d96dd5bc32
commit bb80daf509
4 changed files with 22 additions and 17 deletions

View File

@@ -490,7 +490,10 @@ 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);
fprintf(ar->f, ";");
if (!statement_terminates_without_semicolon(statement))
fprintf(ar->f, ";");
fprintf(ar->f, "\n");
}
ar->indent -= ar->indent_size;