Skip to content

Commit ce052d8

Browse files
committed
Manifest: fix not initializing token locations
1 parent 47a4133 commit ce052d8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Manifest.zig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ pub const multihash_hex_digest_len = 2 * multihash_len;
77
pub const MultiHashHexDigest = [multihash_hex_digest_len]u8;
88

99
pub const Dependency = struct {
10-
location: union(enum) {
11-
url: []const u8,
12-
path: []const u8,
13-
},
10+
location: Location,
1411
location_tok: Ast.TokenIndex,
1512
hash: ?[]const u8,
1613
hash_tok: Ast.TokenIndex,
14+
15+
pub const Location = union(enum) {
16+
url: []const u8,
17+
path: []const u8,
18+
};
1719
};
1820

1921
pub const ErrorMessage = struct {
@@ -249,9 +251,9 @@ const Parse = struct {
249251

250252
var dep: Dependency = .{
251253
.location = undefined,
252-
.location_tok = undefined,
254+
.location_tok = 0,
253255
.hash = null,
254-
.hash_tok = undefined,
256+
.hash_tok = 0,
255257
};
256258
var has_location = false;
257259

0 commit comments

Comments
 (0)