fix: update master.zig to reflect changes to builtins (#858)

This commit is contained in:
Rekai Musuka 2022-12-29 02:00:32 -04:00 committed by GitHub
parent ebe3ba1471
commit aabdb0c6ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,16 +21,14 @@ pub const builtins = [_]Builtin{
}, },
.{ .{
.name = "@addWithOverflow", .name = "@addWithOverflow",
.signature = "@addWithOverflow(comptime T: type, a: T, b: T, result: *T) bool", .signature = "@addWithOverflow(a: anytype, b: anytype) struct { @TypeOf(a, b), u1 }",
.snippet = "@addWithOverflow(${1:comptime T: type}, ${2:a: T}, ${3:b: T}, ${4:result: *T})", .snippet = "@addWithOverflow(${1:a: anytype}, ${2:b: anytype})",
.documentation = .documentation =
\\Performs `result.* = a + b`. If overflow or underflow occurs, stores the overflowed bits in `result` and returns `true`. If no overflow or underflow occurs, returns `false`. \\Performs `a + b` and returns a tuple with the result and a possible overflow bit.
, ,
.arguments = &.{ .arguments = &.{
"comptime T: type", "a: anytype",
"a: T", "b: anytype",
"b: T",
"result: *T",
}, },
}, },
.{ .{
@ -1066,16 +1064,14 @@ pub const builtins = [_]Builtin{
}, },
.{ .{
.name = "@mulWithOverflow", .name = "@mulWithOverflow",
.signature = "@mulWithOverflow(comptime T: type, a: T, b: T, result: *T) bool", .signature = "@mulWithOverflow(a: anytype, b: anytype) struct { @TypeOf(a, b), u1 }",
.snippet = "@mulWithOverflow(${1:comptime T: type}, ${2:a: T}, ${3:b: T}, ${4:result: *T})", .snippet = "@mulWithOverflow(${1:a: anytype}, ${2:b: anytype})",
.documentation = .documentation =
\\Performs `result.* = a * b`. If overflow or underflow occurs, stores the overflowed bits in `result` and returns `true`. If no overflow or underflow occurs, returns `false`. \\Performs `a * b` and returns a tuple with the result and a possible overflow bit.
, ,
.arguments = &.{ .arguments = &.{
"comptime T: type", "a: anytype",
"a: T", "b: anytype",
"b: T",
"result: *T",
}, },
}, },
.{ .{
@ -1326,18 +1322,16 @@ pub const builtins = [_]Builtin{
}, },
.{ .{
.name = "@shlWithOverflow", .name = "@shlWithOverflow",
.signature = "@shlWithOverflow(comptime T: type, a: T, shift_amt: Log2T, result: *T) bool", .signature = "@shlWithOverflow(a: anytype, shift_amt: Log2T) struct { @TypeOf(a), u1 }",
.snippet = "@shlWithOverflow(${1:comptime T: type}, ${2:a: T}, ${3:shift_amt: Log2T}, ${4:result: *T})", .snippet = "@shlWithOverflow(${1:a: anytype}, ${2:shift_amt: Log2T})",
.documentation = .documentation =
\\Performs `result.* = a << b`. If overflow or underflow occurs, stores the overflowed bits in `result` and returns `true`. If no overflow or underflow occurs, returns `false`. \\Performs `a << b` and returns a tuple with the result and a possible overflow bit.
\\ \\
\\The type of `shift_amt` is an unsigned integer with `log2(@typeInfo(T).Int.bits)` bits. This is because `shift_amt >= @typeInfo(T).Int.bits` is undefined behavior. \\The type of `shift_amt` is an unsigned integer with `log2(@typeInfo(@TypeOf(a)).Int.bits)` bits. This is because `shift_amt >= @typeInfo(@TypeOf(a)).Int.bits` is undefined behavior.
, ,
.arguments = &.{ .arguments = &.{
"comptime T: type", "a: anytype",
"a: T",
"shift_amt: Log2T", "shift_amt: Log2T",
"result: *T",
}, },
}, },
.{ .{
@ -1619,16 +1613,14 @@ pub const builtins = [_]Builtin{
}, },
.{ .{
.name = "@subWithOverflow", .name = "@subWithOverflow",
.signature = "@subWithOverflow(comptime T: type, a: T, b: T, result: *T) bool", .signature = "@subWithOverflow(a: anytype, b: anytype) struct { @TypeOf(a, b), u1 }",
.snippet = "@subWithOverflow(${1:comptime T: type}, ${2:a: T}, ${3:b: T}, ${4:result: *T})", .snippet = "@subWithOverflow(${1:a: anytype}, ${2:b: anytype})",
.documentation = .documentation =
\\Performs `result.* = a - b`. If overflow or underflow occurs, stores the overflowed bits in `result` and returns `true`. If no overflow or underflow occurs, returns `false`. \\Performs `a - b` and returns a tuple with the result and a possible overflow bit.
, ,
.arguments = &.{ .arguments = &.{
"comptime T: type", "a: anytype",
"a: T", "b: anytype",
"b: T",
"result: *T",
}, },
}, },
.{ .{
@ -1787,4 +1779,4 @@ pub const builtins = [_]Builtin{
"Element: type", "Element: type",
}, },
}, },
}; };