diff options
| author | Veikka Tuominen <git@vexu.eu> | 2021-01-31 12:37:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-31 12:37:12 +0200 |
| commit | fdc875ed0080cd2542a854a8cd6c627b25e9b7a4 (patch) | |
| tree | 440a26f4a274b02dd67fc8b307e767b6faec24a9 /lib/std/json.zig | |
| parent | 78d2f2b819b4dc90bb112197d376d37e50540493 (diff) | |
| parent | 0b5f3c2ef96df02341cdf54f6eefb3cdb88781d8 (diff) | |
| download | zig-fdc875ed0080cd2542a854a8cd6c627b25e9b7a4.tar.gz zig-fdc875ed0080cd2542a854a8cd6c627b25e9b7a4.zip | |
Merge pull request #7750 from tadeokondrak/6609-tagtype-tag
Remove @TagType; std.meta.TagType -> std.meta.Tag
Diffstat (limited to 'lib/std/json.zig')
| -rw-r--r-- | lib/std/json.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/json.zig b/lib/std/json.zig index 077b910a2c..dc23155a5e 100644 --- a/lib/std/json.zig +++ b/lib/std/json.zig @@ -246,7 +246,7 @@ pub const StreamingParser = struct { // Only call this function to generate array/object final state. pub fn fromInt(x: anytype) State { debug.assert(x == 0 or x == 1); - const T = @TagType(State); + const T = std.meta.Tag(State); return @intToEnum(State, @intCast(T, x)); } }; @@ -1138,7 +1138,7 @@ pub const TokenStream = struct { } }; -fn checkNext(p: *TokenStream, id: std.meta.TagType(Token)) void { +fn checkNext(p: *TokenStream, id: std.meta.Tag(Token)) void { const token = (p.next() catch unreachable).?; debug.assert(std.meta.activeTag(token) == id); } @@ -1782,7 +1782,7 @@ test "parseFree descends into tagged union" { }; // use a string with unicode escape so we know result can't be a reference to global constant const r = try parse(T, &TokenStream.init("\"with\\u0105unicode\""), options); - testing.expectEqual(@TagType(T).string, @as(@TagType(T), r)); + testing.expectEqual(std.meta.Tag(T).string, @as(std.meta.Tag(T), r)); testing.expectEqualSlices(u8, "withÄ…unicode", r.string); testing.expectEqual(@as(usize, 0), fail_alloc.deallocations); parseFree(T, r, options); @@ -2077,7 +2077,7 @@ pub const Parser = struct { } } - fn parseString(p: *Parser, allocator: *Allocator, s: std.meta.TagPayloadType(Token, Token.String), input: []const u8, i: usize) !Value { + fn parseString(p: *Parser, allocator: *Allocator, s: std.meta.TagPayload(Token, Token.String), input: []const u8, i: usize) !Value { const slice = s.slice(input, i); switch (s.escapes) { .None => return Value{ .String = if (p.copy_strings) try allocator.dupe(u8, slice) else slice }, @@ -2090,7 +2090,7 @@ pub const Parser = struct { } } - fn parseNumber(p: *Parser, n: std.meta.TagPayloadType(Token, Token.Number), input: []const u8, i: usize) !Value { + fn parseNumber(p: *Parser, n: std.meta.TagPayload(Token, Token.Number), input: []const u8, i: usize) !Value { return if (n.is_integer) Value{ .Integer = try std.fmt.parseInt(i64, n.slice(input, i), 10) } else |
