Skip to content

Commit

Permalink
Manifest: fix not initializing token locations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Oct 8, 2023
1 parent 47a4133 commit ce052d8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Manifest.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ pub const multihash_hex_digest_len = 2 * multihash_len;
pub const MultiHashHexDigest = [multihash_hex_digest_len]u8;

pub const Dependency = struct {
location: union(enum) {
url: []const u8,
path: []const u8,
},
location: Location,
location_tok: Ast.TokenIndex,
hash: ?[]const u8,
hash_tok: Ast.TokenIndex,

pub const Location = union(enum) {
url: []const u8,
path: []const u8,
};
};

pub const ErrorMessage = struct {
Expand Down Expand Up @@ -249,9 +251,9 @@ const Parse = struct {

var dep: Dependency = .{
.location = undefined,
.location_tok = undefined,
.location_tok = 0,
.hash = null,
.hash_tok = undefined,
.hash_tok = 0,
};
var has_location = false;

Expand Down

0 comments on commit ce052d8

Please sign in to comment.