| ... | @@ -304,7 +304,7 @@ fn transDecl(c: *Context, scope: *Scope, decl: NodeIndex) !void { | ... | @@ -304,7 +304,7 @@ fn transDecl(c: *Context, scope: *Scope, decl: NodeIndex) !void { |
| 304 | .threadlocal_extern_var, | 304 | .threadlocal_extern_var, |
| 305 | .threadlocal_static_var, | 305 | .threadlocal_static_var, |
| 306 | => { | 306 | => { |
| 307 | try transVarDecl(c, decl, null); | 307 | try transVarDecl(c, decl); |
| 308 | }, | 308 | }, |
| 309 | .static_assert => try warn(c, &c.global_scope.base, 0, "ignoring _Static_assert declaration", .{}), | 309 | .static_assert => try warn(c, &c.global_scope.base, 0, "ignoring _Static_assert declaration", .{}), |
| 310 | else => unreachable, | 310 | else => unreachable, |
| ... | @@ -566,8 +566,10 @@ fn transFnDecl(c: *Context, fn_decl: NodeIndex) Error!void { | ... | @@ -566,8 +566,10 @@ fn transFnDecl(c: *Context, fn_decl: NodeIndex) Error!void { |
| 566 | return addTopLevelDecl(c, fn_name, proto_node); | 566 | return addTopLevelDecl(c, fn_name, proto_node); |
| 567 | } | 567 | } |
| 568 | | 568 | |
| 569 | fn transVarDecl(_: *Context, _: NodeIndex, _: ?usize) Error!void { | 569 | fn transVarDecl(c: *Context, node: NodeIndex) Error!void { |
| 570 | @panic("TODO"); | 570 | const data = c.tree.nodes.items(.data)[@intFromEnum(node)]; |
| | 571 | const name = c.tree.tokSlice(data.decl.name); |
| | 572 | return failDecl(c, data.decl.name, name, "unable to translate variable declaration", .{}); |
| 571 | } | 573 | } |
| 572 | | 574 | |
| 573 | fn transEnumDecl(c: *Context, scope: *Scope, enum_decl: NodeIndex, field_nodes: []const NodeIndex) Error!void { | 575 | fn transEnumDecl(c: *Context, scope: *Scope, enum_decl: NodeIndex, field_nodes: []const NodeIndex) Error!void { |