| ... | @@ -7,13 +7,15 @@ pub const multihash_hex_digest_len = 2 * multihash_len; | ... | @@ -7,13 +7,15 @@ pub const multihash_hex_digest_len = 2 * multihash_len; |
| 7 | pub const MultiHashHexDigest = [multihash_hex_digest_len]u8; | 7 | pub const MultiHashHexDigest = [multihash_hex_digest_len]u8; |
| 8 | | 8 | |
| 9 | pub const Dependency = struct { | 9 | pub const Dependency = struct { |
| 10 | location: union(enum) { | 10 | location: Location, |
| 11 | url: []const u8, | | |
| 12 | path: []const u8, | | |
| 13 | }, | | |
| 14 | location_tok: Ast.TokenIndex, | 11 | location_tok: Ast.TokenIndex, |
| 15 | hash: ?[]const u8, | 12 | hash: ?[]const u8, |
| 16 | hash_tok: Ast.TokenIndex, | 13 | hash_tok: Ast.TokenIndex, |
| | 14 | |
| | 15 | pub const Location = union(enum) { |
| | 16 | url: []const u8, |
| | 17 | path: []const u8, |
| | 18 | }; |
| 17 | }; | 19 | }; |
| 18 | | 20 | |
| 19 | pub const ErrorMessage = struct { | 21 | pub const ErrorMessage = struct { |
| ... | @@ -249,9 +251,9 @@ const Parse = struct { | ... | @@ -249,9 +251,9 @@ const Parse = struct { |
| 249 | | 251 | |
| 250 | var dep: Dependency = .{ | 252 | var dep: Dependency = .{ |
| 251 | .location = undefined, | 253 | .location = undefined, |
| 252 | .location_tok = undefined, | 254 | .location_tok = 0, |
| 253 | .hash = null, | 255 | .hash = null, |
| 254 | .hash_tok = undefined, | 256 | .hash_tok = 0, |
| 255 | }; | 257 | }; |
| 256 | var has_location = false; | 258 | var has_location = false; |
| 257 | | 259 | |