cgen: add unsafe block braces and comments in generated code (#5674)

pull/5679/head
yuyi 2020-07-05 19:32:39 +08:00 committed by GitHub
parent 0fb28eb42e
commit cda9240632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -836,7 +836,9 @@ fn (mut g Gen) stmt(node ast.Stmt) {
g.writeln('// TypeDecl') g.writeln('// TypeDecl')
} }
ast.UnsafeStmt { ast.UnsafeStmt {
g.writeln('{ // Unsafe block')
g.stmts(node.stmts) g.stmts(node.stmts)
g.writeln('}')
} }
} }
g.stmt_path_pos.delete(g.stmt_path_pos.len - 1) g.stmt_path_pos.delete(g.stmt_path_pos.len - 1)