Skip to content

Commit

Permalink
cgen: improve -g info for {...} and goto label
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Apr 16, 2021
1 parent 80bd297 commit 0b3d165
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vlib/v/gen/c/cgen.v
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0b3d165

Please sign in to comment.