1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

View File

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