cgen: improve -g info for `{...}` and `goto label`

pull/9775/head
Delyan Angelov 2021-04-16 19:13:35 +03:00
parent 80bd2974b4
commit 0b3d1656f0
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 2 additions and 0 deletions

View File

@ -1067,6 +1067,7 @@ fn (mut g Gen) stmt(node ast.Stmt) {
g.gen_assign_stmt(node)
}
ast.Block {
g.write_v_source_line_info(node.pos)
if node.is_unsafe {
g.writeln('{ // Unsafe block')
} else {
@ -1188,6 +1189,7 @@ fn (mut g Gen) stmt(node ast.Stmt) {
g.writeln('$node.name: {}')
}
ast.GotoStmt {
g.write_v_source_line_info(node.pos)
g.writeln('goto $node.name;')
}
ast.HashStmt {