| ... | ... | @@ -420,7 +420,9 @@ fn transCompoundStmtInline( |
| 420 | 420 | while (it != end_it) : (it += 1) { |
| 421 | 421 | const result = try transStmt(rp, parent_scope, it.*, .unused, .r_value); |
| 422 | 422 | scope = result.child_scope; |
| 423 | | try block_node.statements.push(result.node); |
| 423 | std.debug.warn("id: {}\n", result.node.id); |
| 424 | if (result.node != &block_node.base) |
| 425 | try block_node.statements.push(result.node); |
| 424 | 426 | } |
| 425 | 427 | return TransResult{ |
| 426 | 428 | .node = &block_node.base, |
| ... | ... | @@ -493,7 +495,7 @@ fn transDeclStmt(rp: RestorePoint, parent_scope: *Scope, stmt: *const ZigClangDe |
| 493 | 495 | |
| 494 | 496 | const var_scope = try c.a().create(Scope.Var); |
| 495 | 497 | var_scope.* = Scope.Var{ |
| 496 | | .base = Scope{ .id = .Var, .parent = parent_scope }, |
| 498 | .base = Scope{ .id = .Var, .parent = scope }, |
| 497 | 499 | .c_name = c_name, |
| 498 | 500 | .zig_name = c_name, // TODO: getWantedName |
| 499 | 501 | }; |
| ... | ... | @@ -527,11 +529,11 @@ fn transDeclStmt(rp: RestorePoint, parent_scope: *Scope, stmt: *const ZigClangDe |
| 527 | 529 | .eq_token = eq_token, |
| 528 | 530 | .mut_token = mut_token, |
| 529 | 531 | .comptime_token = null, |
| 530 | | .extern_export_token = null, // TODO ?TokenIndex, |
| 531 | | .lib_name = null, // TODO ?*Node, |
| 532 | .extern_export_token = null, |
| 533 | .lib_name = null, |
| 532 | 534 | .type_node = type_node, |
| 533 | 535 | .align_node = null, // TODO ?*Node, |
| 534 | | .section_node = null, // TODO ?*Node, |
| 536 | .section_node = null, |
| 535 | 537 | .init_node = init_node, |
| 536 | 538 | .semicolon_token = semicolon_token, |
| 537 | 539 | }; |